fix(orchestrion): Stop force-bundling instrumented deps in dev servers - #23835
Merged
chargome merged 1 commit intoSep 1, 2026
Merged
Conversation
The Vite plugin's `ssr.noExternal` and the Nuxt module's Nitro `externals.inline` force-bundle every instrumented package unconditionally. That is required for a production build, but in a dev server it breaks the drivers outright: Vite's dev SSR runner has no CommonJS interop, so an inlined `ioredis`/`mysql` throws `exports is not defined` on first import (Vite 5, 6, 7 and 8), and Nitro's dev server fails with `(0, lodash_1.defaults) is not a function`. Force-bundling also removed the drivers from Node's own module loader, which is where the runtime hook registered by `Sentry.init()` injects the same diagnostics_channel publishers. Dev servers therefore lost DB spans twice over: the build-time transform cannot run there, and the runtime one was locked out. Gate both on the build. Dev now falls through to the runtime hook and emits the same spans, with no user configuration. Nuxt still records no DB spans in dev: Nitro generates the dev `--import` entry as a side-effect manifest of the whole server graph, with `ioredis` and `mysql` hoisted above `Sentry.init()`. That load-order defect is tracked separately; this change only removes the crash there. Fixes #22857 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FWyZ1Vgti4W8q8sEuJsfEY
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 185a968. Configure here.
Contributor
size-limit report 📦
|
chargome
marked this pull request as ready for review
September 1, 2026 14:32
chargome
requested review from
JPeer264,
andreiborza,
mydea,
nicohrubec,
s1gr1d and
timfish
and removed request for
a team
September 1, 2026 14:32
timfish
approved these changes
Sep 1, 2026
chargome
deleted the
chargome/fix/orchestrion-dev-server-instrumentation
branch
September 1, 2026 15:11
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.
The Vite plugin's
ssr.noExternaland the Nuxt module's Nitroexternals.inlineforce-bundle instrumented packages unconditionally. That's right for a build, but in a dev server it breaks the drivers (exports is not definedon Vite,(0, lodash_1.defaults) is not a functionon Nitro) and takes them off Node's module loader, where the runtime hookSentry.init()registers would have instrumented them instead.Gate both on the build. Dev falls through to the runtime hook and emits the same spans.
astro-7 and sveltekit-2 gain a dev pass over their DB tests; the react-router-7 dev skip is removed.
Nuxt still records no DB spans in dev — Nitro hoists
ioredis/mysqlaboveSentry.init()in the generated--importentry. Tracked in #23876; this only removes the crash there.Fixes #22857