Skip to content

feat(remix): Inject debug IDs through the Remix 3 asset server - #24761

Open
chargome wants to merge 1 commit into
charlygomez/js-3768-remix-3-client-error-capturefrom
charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids
Open

chargome wants to merge 1 commit into
charlygomez/js-3768-remix-3-client-error-capturefrom
charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids

Conversation

@chargome

@chargome chargome commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Remix 3 has no build step, so there is no bundler plugin to inject debug IDs. The asset server compiles each module on request, and this patches createAssetServer to add a loader that injects the debug ID snippet into every compiled module. The ID is a hash of the compiled source and the module URL, so it is stable across requests and the source map upload can arrive at the same ID in another process.

The minifier drops comments and the asset server rebuilds source maps after the loaders ran. So the //# debugId= comment and the debugId field in the map, which is what sentry-cli reads, are added to the served response instead.

Source maps follow the other meta framework SDKs. Left out, they are generated but hidden: modules do not reference them and .map requests are not served. sourceMaps: false keeps them off, with a warning that stack traces stay minified.

getDebugId and the snippet mirror @sentry/bundler-plugins/core rather than importing it, because that entry loads the whole build plugin into the server.

Fixes #24667

@chargome chargome self-assigned this Sep 25, 2026
@linear-code

linear-code Bot commented Sep 25, 2026

Copy link
Copy Markdown

JS-3770

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.51 kB - -
@sentry/browser - with treeshaking flags 27.68 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.58 kB - -
@sentry/browser (incl. Tracing) 51.46 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.47 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.47 kB - -
@sentry/browser (incl. Tracing, Replay) 91.05 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.03 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.73 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.72 kB - -
@sentry/browser (incl. Feedback) 47.04 kB - -
@sentry/browser (incl. sendFeedback) 34.57 kB - -
@sentry/browser (incl. FeedbackAsync) 39.69 kB - -
@sentry/browser (incl. Metrics) 30.53 kB - -
@sentry/browser (incl. Logs) 30.82 kB - -
@sentry/browser (incl. Metrics & Logs) 31.48 kB - -
@sentry/react 31.36 kB - -
@sentry/react (incl. Tracing) 53.82 kB - -
@sentry/vue 37.51 kB - -
@sentry/vue (incl. Tracing) 54.36 kB - -
@sentry/svelte 29.54 kB - -
CDN Bundle 31.22 kB - -
CDN Bundle (incl. Tracing) 51.99 kB - -
CDN Bundle (incl. Logs, Metrics) 33.46 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.94 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.2 kB - -
CDN Bundle (incl. Tracing, Replay) 89.56 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.54 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.73 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.73 kB - -
CDN Bundle - uncompressed 92.14 kB - -
CDN Bundle (incl. Tracing) - uncompressed 154.53 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.71 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 160.48 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 228.28 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 274.26 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 280.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.89 kB - -
@sentry/nextjs (client) 56.33 kB - -
@sentry/sveltekit (client) 51.88 kB - -
@sentry/core/server 39.99 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 144.36 kB +0.04% +50 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.05 kB +0.04% +32 B 🔺
@sentry/node - without tracing 93 kB +0.06% +48 B 🔺
@sentry/node - without channel injection 122.66 kB +0.01% +12 B 🔺
@sentry/aws-serverless 101.29 kB +0.05% +43 B 🔺
@sentry/cloudflare (withSentry) - minified 206.83 kB - -
@sentry/cloudflare (withSentry) 514.6 kB - -
@sentry/remix (Remix 3 client bundle) 55.75 kB added added

View base workflow run

@chargome
chargome force-pushed the charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids branch from f24aa9d to 652eba6 Compare September 30, 2026 09:52
@chargome
chargome changed the base branch from develop to charlygomez/js-3768-remix-3-client-error-capture September 30, 2026 09:52
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@chargome
chargome added this pull request to stack #24875 September 30, 2026 09:53

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/remix/test/v3/assetServer.test.ts Outdated
Comment thread packages/remix/src/v3/assetServer.ts
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@chargome
chargome force-pushed the charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids branch from 652eba6 to 617f5b4 Compare September 30, 2026 10:02

@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.

Stale Bugbot comment from a previous run.

@chargome
chargome removed this pull request from stack #24875 September 30, 2026 11:41
@chargome
chargome added this pull request to stack #24884 September 30, 2026 11:41
@chargome
chargome force-pushed the charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids branch from 617f5b4 to 22bb2d8 Compare September 30, 2026 13:41
@chargome
chargome force-pushed the charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids branch 2 times, most recently from 5ddd4a6 to 0b89ad2 Compare September 30, 2026 14:23
@chargome
chargome force-pushed the charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids branch from 0b89ad2 to 54eb070 Compare September 30, 2026 14:43
@chargome

Copy link
Copy Markdown
Member Author

bugbot 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.

Stale Bugbot comment from a previous run.

Comment thread dev-packages/e2e-tests/test-applications/remix-v3/tests/debug-ids.test.ts Outdated
@chargome
chargome force-pushed the charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids branch from 54eb070 to 3ffe768 Compare September 30, 2026 15:01
@chargome

Copy link
Copy Markdown
Member Author

bugbot 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.

✅ 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 3ffe768. Configure here.

@chargome
chargome marked this pull request as ready for review September 30, 2026 15:24
@chargome
chargome requested review from a team as code owners September 30, 2026 15:24
@chargome
chargome removed the request for review from a team September 30, 2026 15:24
@chargome
chargome requested review from isaacs, mydea, nicohrubec and s1gr1d and removed request for a team September 30, 2026 15:24
@chargome
chargome force-pushed the charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids branch from 3ffe768 to 78f8a55 Compare October 1, 2026 08:12
Comment on lines +9 to 13
scripts: {
define: { 'process.env.E2E_TEST_DSN': JSON.stringify(process.env.E2E_TEST_DSN) },
},
watch: false,
scripts: {

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.

I think you'll get an error here but there are two script keys

Comment on lines +93 to +95
asyncStart() {},
asyncEnd() {},
error() {},

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.

Can those be removed? Check if this is optional

Patches createAssetServer so every browser module it serves carries a debug
ID, with no config from the app. Source maps follow the other meta framework
SDKs: generated but hidden unless the app configures them.

Fixes #24667
Refs JS-3770

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chargome
chargome force-pushed the charlygomez/js-3770-integrate-with-the-remix-3-asset-server-for-debug-ids branch from 78f8a55 to dc1a7a0 Compare October 1, 2026 13:33

This branch has not been deployed

No deployments
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.

Integrate with the Remix 3 asset server for debug IDs

2 participants