fix(nextjs): Stop baking absolute paths into server chunks - #23267
Open
chargome wants to merge 2 commits into
Open
fix(nextjs): Stop baking absolute paths into server chunks#23267chargome wants to merge 2 commits into
chargome wants to merge 2 commits into
Conversation
`next build` with webpack emitted the orchestrion runtime as `commonjs <absolute build path>` externals, which only resolve on the machine that built them — so any deploy that relocates the output (Vercel, Docker, `output: 'standalone'`) hit `MODULE_NOT_FOUND` on the first dynamic route. The runtime has to stay external, and a bare `@sentry/server-utils` doesn't resolve from `.next/server/**` under isolated installs. It's now reached through `@sentry/nextjs`, which is always a direct dependency, so the specifier survives the output being moved. Fixes #23266 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
buglitzer kum |
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 757ba04. Configure here.
Contributor
size-limit report 📦
|
`build/orchestrion-runtime` was not in the `build:transpile` Nx outputs, so it was neither cached nor uploaded as a CI build artifact — leaving the unit-test job and every packed tarball without it. Same override `@sentry/node` already uses for its `import-hook.mjs`, which was missing here too. Also read directory entries with `withFileTypes` instead of a separate `statSync` before each read, which drops a syscall per entry and the CodeQL file-system-race warning it raised. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
chargome
commented
Aug 11, 2026
Comment on lines
+118
to
+131
| "nx": { | ||
| "targets": { | ||
| "build:transpile": { | ||
| "outputs": [ | ||
| "{projectRoot}/build/esm", | ||
| "{projectRoot}/build/cjs", | ||
| "{projectRoot}/build/npm/esm", | ||
| "{projectRoot}/build/npm/cjs", | ||
| "{projectRoot}/build/import-hook.mjs", | ||
| "{projectRoot}/build/orchestrion-runtime" | ||
| ] | ||
| } | ||
| } | ||
| }, |
Member
Author
There was a problem hiding this comment.
Nx and CI only keep the build files a package explicitly declares, so this was needed for tarballs, artifacts etc
chargome
marked this pull request as ready for review
August 11, 2026 12:13
chargome
requested review from
JPeer264,
andreiborza,
mydea,
s1gr1d and
timfish
and removed request for
a team,
mydea and
s1gr1d
August 11, 2026 12:13
timfish
approved these changes
Aug 11, 2026
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.
next buildwith webpack emitted the orchestrion runtime ascommonjs <absolute build path>externals, which only resolve on the machine that built them — so any deploy that relocates the output (Vercel, Docker,output: 'standalone') hitMODULE_NOT_FOUNDon the first dynamic route. E2E builds and runs in place, hence green CI.The runtime has to stay external, and a bare
@sentry/server-utilsdoesn't resolve from.next/server/**under isolated installs. It's now reached through@sentry/nextjs, which is always a direct dependency, so the specifier survives the output being moved.The forwarders are generated from
@sentry/server-utils' exports map, so a we do not need to maintain this manually.closes #23266