Repository navigation
fix(docker): build Next.js images with Node 22 - #361
Merged
Merged
Conversation
Bun-only builders executed Next.js through the node-to-Bun fallback, which crashes loading the Next.js 16.3.6 production page runtime. Copy the real Node 22 binary into both builders and invoke Next explicitly with it. Keep Bun 1.3.5 for frozen dependency installs. Build Docker images on pull requests that change the Next.js build inputs, without publishing, so runtime incompatibilities are caught before merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After upgrading to Next.js 16.3.6, the UI and registry images compile and typecheck but crash when collecting page data. Their builders only contain Bun 1.3.5:
noderesolves to Bun's fallback, and the Next.js production page runtime fails withExpected CommonJS module to have a function wrapperbefore Bun exits with code 132. Local builds with a real Node executable did not exercise this path.Copy the Node 22 binary into both builders and explicitly invoke the Next CLI with it, matching the production runner's Node major. Bun 1.3.5 still installs the frozen workspace. Also run the existing Docker matrix on PRs that change Next.js dependency/build inputs; PR builds skip registry login and image publication so these failures are caught before merge.
Validation:
linux/amd64: the original registry Dockerfile reproduces the CI crash and exit 132; both updated Dockerfiles build complete images successfully./projectredirect, using dummy startup configuration and no external services or database.bun typecheck,bun check,bun lint, and actionlint pass.Failure reference: https://github.com/labring/brain/actions/runs/38388805596