Skip to content

fix(infra): use --legacy flag for pnpm deploy in server Dockerfile - #23

Open
iis-MarkKuang wants to merge 1 commit into
rogeriochaves:mainfrom
iis-MarkKuang:fix/infra-pnpm-deploy-legacy
Open

fix(infra): use --legacy flag for pnpm deploy in server Dockerfile#23
iis-MarkKuang wants to merge 1 commit into
rogeriochaves:mainfrom
iis-MarkKuang:fix/infra-pnpm-deploy-legacy

Conversation

@iis-MarkKuang

Copy link
Copy Markdown

Summary

docker compose up fails at the server image build step with:

ERR_PNPM_DEPLOY_NONINJECTED_WORKSPACE  By default, starting from pnpm v10,
we only deploy from workspaces that have "inject-workspace-packages=true" set

The repo pins pnpm 10 (packageManager: "pnpm@10.30.3"), and in pnpm v10 pnpm deploy no longer copies workspace packages unless they opt in via inject-workspace-packages=true. Since @open-managed-agents/server depends on @open-managed-agents/types (workspace:*), the prod-image build step exits 1 and the whole stack fails to come up.

This passes the --legacy flag to restore pnpm's pre-v10 deploy behavior, which is the minimal, low-risk fix.

-RUN pnpm --filter @open-managed-agents/server deploy --prod /oma-server
+RUN pnpm --filter @open-managed-agents/server deploy --prod --legacy /oma-server

Why this slipped through CI

The docker-compose CI job only validates that docker-compose.yml parses and declares the expected services — it does not build the images, so this pnpm v10 regression wasn't caught.

Test plan

  • docker compose build server completes without ERR_PNPM_DEPLOY_NONINJECTED_WORKSPACE
  • docker compose up -d brings up postgres + server + web, all healthy
  • curl http://localhost:3001/health returns 200
  • Web UI loads at http://localhost:5173

Notes / follow-ups

  • An alternative fix is setting inject-workspace-packages=true in packages/server/package.json; --legacy was chosen as the smaller change.
  • Consider adding an image-build step to the docker-compose CI job so future build regressions are caught.

pnpm v10 no longer deploys workspaces without inject-workspace-packages,
breaking `docker compose up` at the server build step with
ERR_PNPM_DEPLOY_NONINJECTED_WORKSPACE. Pass --legacy to restore the
pre-v10 deploy behavior so the prod image build succeeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
@iis-MarkKuang
iis-MarkKuang force-pushed the fix/infra-pnpm-deploy-legacy branch from a281fb6 to 4ef65c9 Compare June 9, 2026 12:36
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.

1 participant