Repository navigation
fix(nuxt): Keep @sentry/server-runtime-injection external on Nitro v3 - #24901
Merged
Merged
Conversation
Contributor
size-limit report 📦
|
mydea
marked this pull request as ready for review
October 1, 2026 06:26
mydea
requested review from
JPeer264,
isaacs and
nicohrubec
and removed request for
a team
October 1, 2026 06:26
JPeer264
approved these changes
Oct 1, 2026
Nitro v3 bundles every dependency, including `@sentry/server-runtime-injection`. On Node versions without `Module.registerHooks` (< 24.13), it registers its ESM loader hook through `Module.register`, which needs the hook file on disk. The bundled copy has none, and the fallback package specifier cannot resolve without `node_modules` in the output, so registration failed with a warning. Add the package to Nitro's `traceDeps` so it ships in `.output/server/node_modules`. Also include the underlying error in the registration failure warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mydea
force-pushed
the
fix/nuxt-5-runtime-injection-external
branch
from
October 12, 2026 13:14
71a0596 to
d1543c5
Compare
47 tasks done
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.
On Nuxt 5 (Nitro v3) with Node < 24.13, server startup logged
Failed to register diagnostics-channel injection hooks. Nitro v3 bundles every dependency, including@sentry/server-runtime-injection. WithoutModule.registerHooks, it registers its ESM loader hook throughModule.register, which needshook.json disk. The bundled copy has no such file, and the fallback@sentry/server-runtime-injection/hookspecifier can't resolve because the output has nonode_modules. Node 24.13+ takes theregisterHookspath and was unaffected, as were Nuxt 3/4, since Nitro v2 keeps dependencies external.The fix adds the package to Nitro's
traceDeps, so it ships in.output/server/node_modules. Note that a Nuxt app with a local module still gets it bundled: Nuxt adds the app root tobuild.transpile, which Nitro v3 turns into an unanchorednoExternalspattern. The traced copy still makes the fallback specifier resolve, so registration works there too.The e2e runner uses Node 24, so the nuxt-5 regression test asserts the hook specifier resolves from the server output rather than checking for the missing warning. The warning now also includes the underlying error, which previously only showed with
debug: true.🤖 Generated with Claude Code