Conversation
isaacs
requested review from
JPeer264 and
mydea
and removed request for
a team
September 16, 2026 00:58
isaacs
added this pull request to stack #24410
September 16, 2026 00:58
Contributor
size-limit report 📦
|
isaacs
marked this pull request as draft
September 16, 2026 03:13
Deno's `nextLoad` reports no module format for a `.json` file, where
Node reports `'json'`. With any load hook installed, Deno's CJS loader
then compiles the JSON as JavaScript, so `require()` of it throws
`SyntaxError: Unexpected token ':'`. A pass-through
`Module.registerHooks({ resolve, load })` reproduces this with no Sentry
code involved, on both Deno 2.8.3 and 2.9.6.
That made `@sentry/deno/import` (as a first import or as a `--preload`)
crash any app whose dependency graph requires JSON. `redis` and
`ioredis` both do, through `@ioredis/commands`.
Restoring the format in our load wrapper is enough. Node never reports a
missing format, so the wrapper only applies on Deno.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
isaacs
force-pushed
the
isaacs/deno-require-json
branch
from
September 16, 2026 03:58
baf860d to
c7e9f4f
Compare
isaacs
marked this pull request as ready for review
September 16, 2026 04:00
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.
Deno's
nextLoadreports no module format for a.jsonfile, where Node reports'json'. With any load hook installed, Deno's CJS loader then compiles the JSON as JavaScript, sorequire()of it throwsSyntaxError: Unexpected token ':'. A pass-throughModule.registerHooks({ resolve, load })reproduces this with no Sentry code involved, on both Deno 2.8.3 and 2.9.6.That made
@sentry/deno/import(as a first import or as a--preload) crash any app whose dependency graph requires JSON.redisandioredisboth do, through@ioredis/commands.Restoring the format in our load wrapper is enough. Node never reports a missing format, so the wrapper only applies on Deno.