Repository navigation
Conversation
…ted snippet The debug ID snippet resolved the global object by checking `global` before `globalThis`. A second bundling pass over an already-injected chunk can rewrite that free `global` into a `const` declared further down the file, which Nitro's node compat does. Reading it from the top of the file then hits the temporal dead zone, where `typeof` throws instead of returning "undefined", and the snippet's own try/catch swallowed the error. The chunk registered no debug ID and its frames stayed unsymbolicated. Checking `globalThis` first means the other identifiers are never evaluated in any runtime that has it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264
added this pull request to stack #25366
October 14, 2026 13:08
JPeer264
marked this pull request as ready for review
October 14, 2026 13:08
JPeer264
requested review from
chargome and
s1gr1d
and removed request for
a team
October 14, 2026 13:08
Member
Author
|
bugbot run |
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 57ee188. Configure here.
This branch has not been deployed
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.
part of #20051
part of JS-2027
Description
This changes the injected debug ID snippet to check
globalThisbeforewindowandglobal. The same header in the Next.js module metadata loader and the Remix v3 debug ID helper gets the same order.Why
When a second bundler runs over a chunk that already has the snippet, it can turn the free
globalinto aconstdeclared further down in the file. Nitro's node compat does this for the server runtime chunk. The snippet then reads that binding in the temporal dead zone,typeofthrows, and the snippet's owntry/catchhides the error. The chunk registers no debug ID, and Sentry reportsjs_no_sourcefor all of its frames although the map was uploaded.Known issues
no_bundleandrulesin the wrangler config, so that wrangler does not merge the Nitro chunks into oneindex.js. This is a documentation change.@sentry/nuxt@10uses@sentry/vite-pluginand@sentry/rollup-pluginfromsentry-javascript-bundler-plugins. The v10 line needs the same change there.Sentry events
Before,
nitro.mjshas no debug ID, 7 frames unresolved: https://sentry-sdks.sentry.io/issues/7717023698/events/68bf257795504851aa62d6a642b0dd85/?project=4510555608449024After, all frames resolved: https://sentry-sdks.sentry.io/issues/7717259820/events/9939fb348971417091c1a05b91ce5023/?project=4510555608449024
Most of the changed files are test snapshots that contain the snippet text.