Conversation
JPeer264
added this pull request to stack #24670
September 23, 2026 16:19
Contributor
size-limit report 📦
|
Deno's module hooks report no `format` for an ES module, so the orchestrion transform treated it as CommonJS and injected a `require()` that throws when the module loads. This broke `@sentry/node` on Deno for the ESM builds of libraries it instruments, such as the AI SDKs and `postgres`. The Deno load hook now restores the format of `.mjs` files and of `.js` files in a `"type": "module"` package, the same way it already did for JSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/node-suites-deno-esm-fix
branch
from
September 23, 2026 16:40
055e26b to
540f4fe
Compare
JPeer264
removed this pull request from stack #24670
September 23, 2026 17:26
JPeer264
added this pull request to stack #24671
September 23, 2026 17:31
JPeer264
marked this pull request as ready for review
September 23, 2026 17:35
JPeer264
requested review from
andreiborza,
isaacs,
logaretm and
stephanie-anderson
and removed request for
a team,
logaretm and
stephanie-anderson
September 23, 2026 17:35
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.
With
deno run --preload=npm:@sentry/deno/import, an instrumented library that ships an ES module build crashed on import withReferenceError: require is not defined. Deno's module hooks report noformatfor an ES module, so the orchestrion transform treated it as CommonJS and injected arequire()into it. This hit the ESM builds of the AI SDKs andpostgres, among others.The Deno load hook now restores the format of
.mjsfiles and of.jsfiles in a"type": "module"package, the same way it already did for JSON (#24412). It restores it on thenextLoadresult, because the transform reads the format there.Running the shared Node integration suites on Deno found this. The next PR in the stack runs them in CI; the Deno-only orchestrion suites did not catch it because they publish fake channel messages instead of loading the real libraries.
Part of #24052 and #23897.
🤖 Generated with Claude Code