From c58f72877a6437b4541b641f19677cd8249173bb Mon Sep 17 00:00:00 2001 From: Rayan Salhab Date: Sun, 29 Mar 2026 03:43:45 +0000 Subject: [PATCH] fix(cli): strip workspaces from package.json before bun install Bun strictly validates that all workspaces exist before installing, unlike npm/node which just warns. This causes deployments to fail with 'Workspace not found' error when using runtime: 'bun' in projects with workspaces defined in package.json. The fix strips the workspaces field from package.json before running bun install, preventing the validation error. Fixes #3272 --- packages/cli-v3/src/deploy/buildImage.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/cli-v3/src/deploy/buildImage.ts b/packages/cli-v3/src/deploy/buildImage.ts index 2225d7db056..f6886b98764 100644 --- a/packages/cli-v3/src/deploy/buildImage.ts +++ b/packages/cli-v3/src/deploy/buildImage.ts @@ -764,6 +764,9 @@ ${buildArgs} ${buildEnvVars} COPY --chown=bun:bun package.json ./ +# Strip workspaces from package.json before bun install to avoid "Workspace not found" error +# Bun strictly validates workspaces exist, unlike npm/node which just warns +RUN node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.workspaces;fs.writeFileSync('package.json',JSON.stringify(p,null,2))" RUN bun install --production --no-save # Now copy all the files