Skip to content

fix: keep the dashboard image serving on Next 16.3 - #274

Merged
AKogut merged 2 commits into
mainfrom
chore/next-163-probe
Aug 18, 2026
Merged

fix: keep the dashboard image serving on Next 16.3#274
AKogut merged 2 commits into
mainfrom
chore/next-163-probe

Conversation

@AKogut

@AKogut AKogut commented Aug 18, 2026

Copy link
Copy Markdown
Owner

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.

apps/web/.next/standalone/.../@swc/helpers/cjs/_interop_require_default.cjs   traced
apps/web/.next/standalone/.../@swc/helpers/esm/_interop_require_default.js    missing

So the image builds, starts, and fails every request.

The fix

outputFileTracingIncludes pulls the ESM directory in explicitly. The glob covers pnpm's content-addressed layout, where more than one version of @swc/helpers can be present — both were traced here (0.5.15 and 0.5.23).

Proved by breaking it again

Reverting the include and rebuilding:

build exit=0                          ← still succeeds
GET /sign-in                          → HTTP 000, nothing answers
log: Cannot find module '.../@swc/helpers/esm/_interop_require_default.js'

With the include, the standalone server runs and serves /sign-in 200 and / 307. (The only remaining log line is an Auth.js UntrustedHost, because the probe ran without AUTH_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.yml catching 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.

AKogut added 2 commits August 18, 2026 10:22
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
@AKogut
AKogut merged commit 11d261a into main Aug 18, 2026
5 checks passed
@AKogut
AKogut deleted the chore/next-163-probe branch August 18, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Next 16.3 breaks the standalone Docker image: @swc/helpers is not traced

1 participant