You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Next.js app built with output: 'standalone' starts, serves pages, and records no server spans. The build is green and the server boots, so the only signal is a warning behind debug: true.
Symptom
On the standalone server with debug: true:
Sentry Logger [warn]: Failed to register diagnostics-channel injection hooks;
channel-based integrations will not record spans.
Error: Cannot find module '.../.next/standalone/node_modules/.pnpm/@sentry+server-runtime-injection@.../
@sentry/server-runtime-injection/build/esm/hook.js'
Without debug, there is no signal at all.
Cause
register.ts reaches the ESM loader hook with a runtime registration:
Module.register() resolves its specifier at runtime, so @vercel/nft cannot see it and never traces the target file into the output. On the emitted build, the standalone copy of the package holds build/cjs only. The whole build/esm tree, including hook.js, is absent.
Registration runs inside a try/catch, so the SDK degrades instead of failing. The channel integrations replace the OpenTelemetry ones, so the result is no server spans rather than a fallback.
Scope
Reproduced on the webpack and the turbopack variant.
The package is correctly external here. This is not a bundling problem.
Docker and Vercel builds trace the same way, so they lose channel-based instrumentation too.
Resolve the hook by a literal path relative to register.js, which tracers follow like any other dependency, with the bare self-reference kept as a fallback for a bundled copy. See #23687.
A Next.js app built with
output: 'standalone'starts, serves pages, and records no server spans. The build is green and the server boots, so the only signal is a warning behinddebug: true.Symptom
On the standalone server with
debug: true:Without
debug, there is no signal at all.Cause
register.tsreaches the ESM loader hook with a runtime registration:Module.register()resolves its specifier at runtime, so@vercel/nftcannot see it and never traces the target file into the output. On the emitted build, the standalone copy of the package holdsbuild/cjsonly. The wholebuild/esmtree, includinghook.js, is absent.Registration runs inside a
try/catch, so the SDK degrades instead of failing. The channel integrations replace the OpenTelemetry ones, so the result is no server spans rather than a fallback.Scope
@vercel/nftblind spot as the meriyahmodule-syncissue patched in fix(v10/nextjs):meriyahissue forstandalonebuild #23055.Fix
Resolve the hook by a literal path relative to
register.js, which tracers follow like any other dependency, with the bare self-reference kept as a fallback for a bundled copy. See #23687.Internal tracking: JS-3451