fix(docker): upgrade bun to 1.3.14 - #6236
Conversation
Bun 1.3.13 cannot load Next 16.3.0's compiled server runtime. The app container
runs the Next server under Bun (`oven/bun:1.3.13-slim`, `bun apps/sim/bootstrap.js`),
so every app-page render threw and `/api/health` returned 500:
⨯ Error: Failed to load external module
next/dist/compiled/next-server/app-page-turbo.runtime.prod.js:
TypeError: Expected CommonJS module to have a function wrapper.
If you weren't messing around with Bun's internals, this is a bug in Bun
Isolated to Bun, not Next, by loading that exact module in the real images:
Next 16.2.12 + Bun 1.3.13 -> loads (why staging was fine before)
Next 16.3.0 + Bun 1.3.13 -> CJS wrapper error
Next 16.3.0 + Bun 1.3.14 -> loads
Bun 1.3.14 is the current stable and already fixes it, so this bumps every pin
rather than reverting the framework upgrade, which would only defer the same
latent Bun bug to the next attempt.
Why no gate caught it: local dev machines and this bump's own verification run
Bun 1.3.14, while the container and CI pinned 1.3.13 — and CI only *builds* the
image, it never boots one and probes `/api/health`. A container smoke test in CI
would have caught this before merge; that is worth adding separately.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Pins updated include root Reviewed by Cursor Bugbot for commit 454b8a3. Configure here. |
Greptile SummaryThis PR upgrades the repository’s Bun runtime and toolchain pins from 1.3.13 to 1.3.14 to restore compatibility with the Next 16.3.0 server runtime.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported devcontainer and Pi sandbox version mismatches are fixed, and all active Bun pins now consistently use 1.3.14.
|
| Filename | Overview |
|---|---|
| docker/app.Dockerfile | Updates the application runtime image to Bun 1.3.14, addressing the reported Next 16.3.0 runtime incompatibility. |
| package.json | Aligns the repository’s declared package-manager version with Bun 1.3.14. |
| .devcontainer/Dockerfile | Resolves the previously reported devcontainer mismatch by upgrading its Bun image to 1.3.14. |
| apps/sim/scripts/pi-sandbox-packages.ts | Resolves the previously reported Pi sandbox mismatch by aligning its installed and asserted Bun version with package.json. |
| .github/workflows/ci.yml | Updates both CI Bun setup steps to exercise the repository under Bun 1.3.14. |
| docker/db.Dockerfile | Aligns the database container’s Bun base image with the upgraded toolchain. |
| docker/realtime.Dockerfile | Aligns the realtime container’s Bun base image with the upgraded toolchain. |
Reviews (2): Last reviewed commit: "fix(docker): align the remaining bun pin..." | Re-trigger Greptile
|
Verification promised in the description is done — the fix is confirmed end-to-end, not just at the module-load level. The in-container
Bun 1.3.13 reproduces the staging outage exactly — same error, same 500 on the same endpoint. Bun 1.3.14 serves 200 with zero occurrences. Identical build artifact in both runs; the only variable is the Bun version. Worth noting for the follow-up: this A/B took about two minutes once set up, and it is exactly the check CI is missing. CI builds the image but never boots one, which is why a container that could not serve a single page went green. |
Two pins were missed in the first pass because the search was scoped to docker/, package.json and .github/workflows/: - .devcontainer/Dockerfile still built on oven/bun:1.3.13-alpine - PI_BUN_VERSION in apps/sim/scripts/pi-sandbox-packages.ts was still 1.3.13, despite being documented as mirroring the root packageManager field, so Pi sandbox images would have kept installing the Bun release that cannot load the Next 16.3.0 server runtime. Fixed surgically rather than with a repo-wide replace: "1.3.13" also appears inside SVG path data in apps/sim/components/icons.tsx and apps/docs/components/icons.tsx, which a blind sed would have corrupted.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 454b8a3. Configure here.
Summary
/api/healthreturns 500. This bumps Bun to 1.3.14, which fixes it.oven/bun:1.3.13-slim,CMD ["bun", "apps/sim/bootstrap.js"]), so the failure is at runtime, not build time:Only one cell fails. Bun 1.3.14 is the current stable and already contains the fix, so this bumps every pin rather than reverting #6235 — a revert would only defer the same latent Bun bug to the next framework upgrade.
docker/app.Dockerfile,docker/db.Dockerfile,docker/realtime.Dockerfile,package.jsonpackageManager, andbun-versioninci.yml,test-build.yml,desktop-e2e.yml,desktop-release.yml,docs-embeddings.yml,helm.yml,migrations.yml,publish-cli.yml,publish-ts-sdk.yml.Incident detail
d-8SLBY3ZXK(the image carrying chore(deps): upgrade next to 16.3.0 and clean up the TypeScript toolchain #6235). 745 occurrences, zero before that timestamp.unhealthy/Target.ResponseCodeMismatchon the only target group serving traffic. CodeDeploy reportedSucceededand no rollback fired.main.Why no gate caught it
Local dev machines run Bun 1.3.14, while the container and CI pinned 1.3.13 — so every local check (build, dev, 18k tests, typecheck) ran on the version without the bug. CI pins 1.3.13 but only builds the image; nothing boots a container and probes
/api/health, so CI went green on an image that could not serve a page. A container smoke test in CI would have caught this and is worth adding as a follow-up.Type of Change
Testing
app-page-turbo.runtime.prod.jsinoven/bun:1.3.13-slim(fails) vsoven/bun:1.3.14-slim(loads) — see matrix above./api/healthprobe is running; I'll post the result here before merge.Checklist