fix: keep the dashboard image serving on Next 16.3 - #274
Merged
Conversation
Next 16.3 emits ESM interop helpers but traces only the CJS ones into the standalone output, so the container builds, starts, and then fails every request: Cannot find module '.../@swc/helpers/esm/_interop_require_default.js' The esm directory is in the store; the tracer simply does not follow it. Pulled in explicitly, with a glob that covers pnpm's content-addressed layout where two versions of the package can coexist. This is why the bump was worth chasing rather than closing: the whole production dependency group — fastify, the Anthropic SDK, nodemailer and the rest — was stuck behind it. Proved by reverting rather than by reasoning. Without the include the build still exits 0, the server answers nothing at all, and the log carries the same missing-module line CI reported. With it, the standalone server serves /sign-in 200 and / 307. Closes #271
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.
Closes #271, and unsticks the production dependency group that #265 was carrying.
What breaks
Next 16.3 emits ESM interop helpers but traces only the CJS ones into the standalone output. The
esm/directory is right there in the store; the tracer just does not follow it.So the image builds, starts, and fails every request.
The fix
outputFileTracingIncludespulls the ESM directory in explicitly. The glob covers pnpm's content-addressed layout, where more than one version of@swc/helperscan be present — both were traced here (0.5.15 and 0.5.23).Proved by breaking it again
Reverting the include and rebuilding:
With the include, the standalone server runs and serves
/sign-in200 and/307. (The only remaining log line is an Auth.jsUntrustedHost, because the probe ran withoutAUTH_TRUST_HOST— unrelated.)The build exiting 0 either way is the point. A build-only check goes green and ships an image that crashes on first request;
stack.ymlcatching this is exactly what it exists for.Scope
This carries the Next bump itself (16.2.11 → 16.3.1) so the fix and the version that needs it land together. The other six members of the group — fastify,
@anthropic-ai/sdk, nodemailer, typescript-eslint and friends — were only blocked by this, and dependabot will re-raise them.