Skip to content

Commit c58f728

Browse files
committed
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
1 parent 2366b21 commit c58f728

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/cli-v3/src/deploy/buildImage.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,9 @@ ${buildArgs}
764764
${buildEnvVars}
765765
766766
COPY --chown=bun:bun package.json ./
767+
# Strip workspaces from package.json before bun install to avoid "Workspace not found" error
768+
# Bun strictly validates workspaces exist, unlike npm/node which just warns
769+
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))"
767770
RUN bun install --production --no-save
768771
769772
# Now copy all the files

0 commit comments

Comments
 (0)