You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nuxt dev server loads DB drivers before Sentry.init() #23876
In nuxt dev, ioredis and mysql never get DB spans. The SDK starts fine and http.server transactions arrive, but the DB spans are missing.
It's a load-order problem. Nitro generates .nuxt/dev/sentry.server.config.mjs, the file nuxt dev passes to --import, as a list of imports for the whole dev server:
import'./index.mjs';// the whole Nitro dev server// … a few more imports …import'…/node_modules/ioredis/built/index.js';import'…/node_modules/mysql/index.js';// … more imports, then Sentry.init() somewhere inside
ESM runs all imports before any code, so both drivers are loaded by the time Sentry.init() runs, and the runtime hook can't instrument a module that loaded first. A probe on Module.prototype._compile confirms it: when ioredis compiles, globalThis.__SENTRY_ORCHESTRION__ doesn't exist yet.
This isn't only about orchestrion. Anything that needs Sentry.init() to run before a dependency loads is unreliable in nuxt dev.
Repro: in dev-packages/e2e-tests/test-applications/nuxt-4, run bash ./nuxt-start-dev-server.bash && TEST_ENV=development playwright test db-drivers. Both tests time out; the dev pass is filtered to environment today for this reason.
Found while working on JS-3233 (#22857). Blocks the nuxt-4 dev DB tests (#23836).
#24094 removes the generated dev preload file: now the server config is bundled into the dev server, so Sentry.init() runs before lazy handlers load their drivers. mysql now gets DB spans in nuxt dev, and test:dev now also runs db-drivers as a regression test.
But ioredis (pinned to 5.10.1, without native tracing channels) still misses spans: dev has no build-time transform, and runtime injection comes too late for it. The dev bundle hoists the ioredis import above the inlined Sentry.init, so its instrumented file loads before the injection hooks exist. mysql only escapes because it requires its instrumented file lazily, after init. Prod is unaffected, channels are compiled in there.
We could do a follow-up to instrument dev as well: eager subscription for native-channel libraries, and the orchestrion dev transform (for non-native tracing channels).
Activity
linear-code commentedon Sep 1, 2026
JS-3506
s1gr1d commentedon Sep 7, 2026
#24094 removes the generated dev preload file: now the server config is bundled into the dev server, so
Sentry.init()runs before lazy handlers load their drivers. mysql now gets DB spans innuxt dev, andtest:devnow also runsdb-driversas a regression test.But ioredis (pinned to 5.10.1, without native tracing channels) still misses spans: dev has no build-time transform, and runtime injection comes too late for it. The dev bundle hoists the ioredis import above the inlined
Sentry.init, so its instrumented file loads before the injection hooks exist. mysql only escapes because it requires its instrumented file lazily, after init. Prod is unaffected, channels are compiled in there.We could do a follow-up to instrument dev as well: eager subscription for native-channel libraries, and the orchestrion dev transform (for non-native tracing channels).