Skip to content

fix(server-runtime-injection): Load ESM hook without the build/esm package.json marker - #25562

Merged
andreiborza merged 2 commits into
developfrom
ab/fix-esm-hook-format
Oct 21, 2026
Merged

andreiborza merged 2 commits into
developfrom
ab/fix-esm-hook-format

Conversation

@andreiborza

Copy link
Copy Markdown
Member

What

The diagnostics-channel hook now loads as ESM even when build/esm/package.json is missing from a deployment.

Why

Vercel runs Node 22 with syntax detection off, so without that file the hook failed to load and channel-based spans were lost.

Closes: #25480

…ckage.json marker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 5dbf07c (PR test merge using develop at 2028b68)

Against: 2028b68 (develop) · base run #62870

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 29.91 kB - -
@sentry/browser - with treeshaking flags 28.04 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.95 kB - -
@sentry/browser (incl. Tracing) 52.1 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.1 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.04 kB - -
@sentry/browser (incl. Tracing, Replay) 91.85 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.72 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 96.58 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 109.52 kB - -
@sentry/browser (incl. Feedback) 47.42 kB - -
@sentry/browser (incl. sendFeedback) 34.97 kB - -
@sentry/browser (incl. FeedbackAsync) 40.07 kB - -
@sentry/browser (incl. Metrics) 30.93 kB - -
@sentry/browser (incl. Logs) 31.21 kB - -
@sentry/browser (incl. Metrics & Logs) 31.84 kB - -
@sentry/react 31.73 kB - -
@sentry/react (incl. Tracing) 54.41 kB - -
@sentry/vue 38.06 kB - -
@sentry/vue (incl. Tracing) 55.03 kB - -
@sentry/svelte 29.93 kB - -
@sentry/remix (Remix 3 client bundle) 57.11 kB - -
CDN Bundle 31.67 kB - -
CDN Bundle (incl. Tracing) 52.61 kB - -
CDN Bundle (incl. Logs, Metrics) 33.87 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.55 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.79 kB - -
CDN Bundle (incl. Tracing, Replay) 90.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.42 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.37 kB - -
CDN Bundle - uncompressed 93.29 kB - -
CDN Bundle (incl. Tracing) - uncompressed 156.14 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.83 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.1 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.87 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.31 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.94 kB - -
@sentry/nextjs (client) 57.3 kB - -
@sentry/sveltekit (client) 52.48 kB - -
@sentry/core/server 41.8 kB - -
@sentry/core/browser 13.81 kB - -
@sentry/node 155.4 kB +0.07% +95 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 84.17 kB +0.13% +108 B 🔺
@sentry/node - without tracing 97.04 kB +0.1% +96 B 🔺
@sentry/node - without channel injection 133.29 kB +0.01% +1 B 🔺
@sentry/aws-serverless 105.22 kB +0.09% +92 B 🔺
@sentry/cloudflare (withSentry) - minified 210.99 kB - -
@sentry/cloudflare (withSentry) 523.33 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 230.62 kB - -

View base workflow run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5084a8e. Configure here.

Comment thread packages/server-runtime-injection/src/register.ts
@andreiborza
andreiborza marked this pull request as ready for review October 21, 2026 09:36
@andreiborza
andreiborza requested a review from a team as a code owner October 21, 2026 09:36
@andreiborza
andreiborza requested review from isaacs, mydea and timfish and removed request for a team October 21, 2026 09:36

@mydea mydea left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funky, but I guess if it works...

@andreiborza

Copy link
Copy Markdown
Member Author

Yep, I tested this by deploying to Vercel and it does work. Also the added test fails without the fix.

@andreiborza
andreiborza merged commit 00ee6b7 into develop Oct 21, 2026
736 of 748 checks passed
@andreiborza
andreiborza deleted the ab/fix-esm-hook-format branch October 21, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

server-runtime-injection: build/esm/package.json is not traced, so hook.js fails to load as ESM on Vercel (Node 22)

2 participants