Skip to content

Conversation

@gpailler
Copy link
Collaborator

@gpailler gpailler commented Dec 2, 2025

Summary by CodeRabbit

  • Chores
    • Simplified development environment setup configuration by streamlining the installation process.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 2, 2025

Walkthrough

The updateContentCommand in the dev container configuration was simplified by removing the explicit corepack enable invocation. The pnpm package manager installation command remains unchanged, potentially relying on implicit Corepack initialization or an already-enabled Corepack state.

Changes

Cohort / File(s) Summary
Dev container configuration
.devcontainer/devcontainer.json
Removed corepack enable from updateContentCommand, leaving only pnpm install --frozen-lockfile

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single line change in a configuration file with no logic impact

Poem

🐰 One command fewer, the config grows lean,
No need to enable what's always been seen!
Corepack whispers, "I'm always awake,"
Pnpm installs smooth, for dev's sake. 📦✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix codespaces init' is concise and directly related to the changeset, which modifies the devcontainer configuration's updateContentCommand for Codespaces initialization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-devcontainer-init

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 297b913 and c3ade15.

📒 Files selected for processing (1)
  • .devcontainer/devcontainer.json (1 hunks)

},
// Install required modules
"updateContentCommand": "corepack enable && pnpm install --frozen-lockfile",
"updateContentCommand": "pnpm install --frozen-lockfile",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Node.js 24 Corepack enabled by default

💡 Result:

Short answer: No — Node.js 24 ships Corepack but it is not enabled by default. You must run corepack enable (or use corepack use/install) to activate its shims. Corepack is distributed with Node.js through v24 but the project has decided to stop bundling it in future (25+). [1][2][3]

Sources:
[1] Node.js Corepack docs (v24/nightly) — explains Corepack is included and “needs to be explicitly enabled”.
[2] nodejs/corepack README — notes Corepack is distributed with Node.js from 14.19.0 up to (but not including) 25.0.0.
[3] Reporting on Node TSC decision / GitHub discussion — TSC voted to stop distributing Corepack for future releases (impacting 25+).


🌐 Web query:

devcontainers typescript-node:24 Corepack configuration

💡 Result:

Short answer + examples.

Why: Node images (including mcr.microsoft.com/devcontainers/typescript-node:24) may include Node.js with Corepack, but you should enable/prepare Corepack and ensure COREPACK_HOME is writable so pnpm/yarn are available predictably. [1][2][3]

Recommended options (pick one):

  1. devcontainer.json postCreateCommand (quick, runs as container user)
  • "postCreateCommand": "corepack enable && corepack prepare pnpm@latest --activate"
    This enables Corepack and activates the pnpm shim for the container session. [1][2]
  1. Dockerfile (make it part of the image; good for CI/reproducible builds)
  • RUN corepack enable
    && corepack prepare pnpm@9.*/--activate
    Make sure COREPACK_HOME is writable during prepare (avoid read-only Node install dirs). If your build environment uses a read-only install, set COREPACK_HOME to a writable path (e.g. /usr/local/share/corepack) and add it to PATH. [1][3]
  1. Pin package manager in package.json (reproducible)
  • Run: corepack use pnpm@
    This writes packageManager to package.json so Corepack will always use that version for the project. (If auto-pin doesn’t happen in your workflow, run the command explicitly or add packageManager manually). [2]

Example devcontainer.json snippet

  • {
    "image": "mcr.microsoft.com/devcontainers/typescript-node:24",
    "postCreateCommand": "corepack enable && corepack prepare [email protected] --activate"
    }

Example Dockerfile snippet

  • FROM mcr.microsoft.com/devcontainers/typescript-node:24
    ENV COREPACK_HOME=/usr/local/share/corepack
    RUN mkdir -p $COREPACK_HOME && chown root:root $COREPACK_HOME &&
    corepack enable && corepack prepare [email protected] --activate

Notes / gotchas

  • Corepack may not auto-add packageManager to package.json in some installs; pin manually if needed. [2]
  • If COREPACK_HOME or Node install area is read-only, Corepack prepare/activate will fail — use a writable COREPACK_HOME. [1][3]
  • You can also install pnpm directly in the image (curl installer) if you prefer not to rely on Corepack. [2]

Sources

  • Corepack (Node.js / GitHub) — how enable/prepare/use and COREPACK_HOME behavior. [1]
  • pnpm installation & Corepack usage guidance (pnpm docs). [2]
  • devcontainers/images repo / image metadata for typescript-node:24 (image base & build guidance). [3]

Do not remove corepack enablepnpm install will fail without it.

Node.js 24 includes Corepack but does not enable it by default. The mcr.microsoft.com/devcontainers/typescript-node:24 image likewise does not enable Corepack by default. Without corepack enable, the pnpm shims are unavailable, and pnpm install --frozen-lockfile will fail during dev container initialization.

Restore corepack enable && in the updateContentCommand, or move the Corepack activation to postCreateCommand or the Dockerfile if you prefer that approach.

🤖 Prompt for AI Agents
.devcontainer/devcontainer.json around line 21: the updateContentCommand
currently runs "pnpm install --frozen-lockfile" but Corepack is not enabled by
default in the Node 24 base image so pnpm shims will be missing and install will
fail; reintroduce Corepack activation by prefixing the command with "corepack
enable &&" (or alternatively enable Corepack in postCreateCommand or the
Dockerfile) so that the pnpm binary is available before running the install.

@gpailler gpailler merged commit ec0249b into main Dec 2, 2025
4 checks passed
@gpailler gpailler deleted the fix-devcontainer-init branch December 2, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants