Title: bug: Bun runtime deploy fails with workspaces in package.json ("Workspace not found") · Issue #3272 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: bug: Bun runtime deploy fails with workspaces in package.json ("Workspace not found") · Issue #3272 · triggerdotdev/trigger.dev
X Title: bug: Bun runtime deploy fails with workspaces in package.json ("Workspace not found") · Issue #3272 · triggerdotdev/trigger.dev
Description: Description When using runtime: 'bun' in trigger.config.ts, deploying a project that has "workspaces" in package.json fails with: error: Workspace not found "frontend" at /app/package.json:50:5 The same project deploys successfully with ...
Open Graph Description: Description When using runtime: 'bun' in trigger.config.ts, deploying a project that has "workspaces" in package.json fails with: error: Workspace not found "frontend" at /app/package.json:50:5 The...
X Description: Description When using runtime: 'bun' in trigger.config.ts, deploying a project that has "workspaces" in package.json fails with: error: Workspace not found "frontend" a...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/3272
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: Bun runtime deploy fails with workspaces in package.json (\"Workspace not found\")","articleBody":"## Description\n\nWhen using `runtime: 'bun'` in `trigger.config.ts`, deploying a project that has `\"workspaces\"` in `package.json` fails with:\n\n```\nerror: Workspace not found \"frontend\"\n at /app/package.json:50:5\n```\n\nThe same project deploys successfully with `runtime: 'node-22'`.\n\n## Root Cause\n\nThe generated Containerfile copies only `package.json` before running `bun install`:\n\n```dockerfile\nCOPY --chown=bun:bun package.json ./ # Only root package.json\nRUN bun install --production --no-save # Bun validates workspaces strictly → ERROR\nCOPY --chown=bun:bun . ./ # Workspace dirs arrive here, too late\n```\n\n**npm/node** tolerates missing workspace directories during install (warns but continues).\n**Bun** strictly validates that all referenced workspaces exist and exits with an error if they don't.\n\n## Reproduction\n\n1. Have a `package.json` with workspaces:\n```json\n{\n \"workspaces\": [\"frontend\"]\n}\n```\n\n2. Set `runtime: 'bun'` in `trigger.config.ts`:\n```typescript\nexport default defineConfig({\n project: 'my-project',\n runtime: 'bun',\n});\n```\n\n3. Run `trigger deploy` → build fails at the `bun install` step.\n\n4. Change to `runtime: 'node-22'` → build succeeds.\n\n## Environment\n\n- **CLI version**: 4.4.1\n- **Cloud version**: 4.4.3\n- **Bun version in image**: 1.3.3 (`imbios/bun-node:1.3.3-20-slim`)\n- **OS**: Ubuntu (GitHub Actions CI)\n\n## Suggested Fix\n\nWhen `runtime: 'bun'`, the Containerfile should handle workspaces before `bun install`. Some options:\n\n1. **Copy workspace `package.json` files** alongside the root `package.json` before install:\n ```dockerfile\n COPY --chown=bun:bun package.json ./\n COPY --chown=bun:bun frontend/package.json ./frontend/\n RUN bun install --production --no-save\n ```\n\n2. **Strip the `workspaces` field** from package.json before running `bun install`:\n ```dockerfile\n COPY --chown=bun:bun package.json ./\n RUN node -e \"const p=JSON.parse(require('fs').readFileSync('package.json','utf8'));delete p.workspaces;require('fs').writeFileSync('package.json',JSON.stringify(p,null,2))\"\n RUN bun install --production --no-save\n ```\n\n3. **Allow build extensions** to inject Containerfile instructions between `COPY package.json` and `RUN bun install` (currently `addLayer` only appends after the main build steps).\n\n## Workaround\n\nUse `runtime: 'node-22'` instead of `'bun'`. With `processKeepAlive: true`, warm starts are 100-300ms regardless of runtime, so the cold start difference is negligible for most workloads.","author":{"url":"https://github.com/mouguu","@type":"Person","name":"mouguu"},"datePublished":"2026-03-26T03:44:35Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/3272"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:23f5c416-ce7f-c684-e1ec-0ff685620538 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E246:F138D:154CC11:1D13D4C:6AFB7869 |
| html-safe-nonce | 6faae7473e7eff8fb4c30c82cc4d346cad8fc41910a519198ba7a18c3f9fc0ec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjQ2OkYxMzhEOjE1NENDMTE6MUQxM0Q0Qzo2QUZCNzg2OSIsInZpc2l0b3JfaWQiOiI5MTk2ODYxNTA3NjMzOTAzNzIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4d6153b423cb3cd70d7a43840718f115731364b0bfb2fedddd71405d1490957c |
| hovercard-subject-tag | issue:4140266137 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/3272/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9aeaef7047b0e6b22acfcd088d99938e6173b775e552cc1663a1e255cf65ca5b/triggerdotdev/trigger.dev/issues/3272 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9aeaef7047b0e6b22acfcd088d99938e6173b775e552cc1663a1e255cf65ca5b/triggerdotdev/trigger.dev/issues/3272 |
| og:image:alt | Description When using runtime: 'bun' in trigger.config.ts, deploying a project that has "workspaces" in package.json fails with: error: Workspace not found "frontend" at /app/package.json:50:5 The... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mouguu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48 |
| turbo-cache-control | no-preview |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2e8872b770cc4d5d0cc1f2026afab747a268e2ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width