Title: Nuxt dev server loads DB drivers before Sentry.init() · Issue #23876 · getsentry/sentry-javascript · GitHub
Open Graph Title: Nuxt dev server loads DB drivers before Sentry.init() · Issue #23876 · getsentry/sentry-javascript
X Title: Nuxt dev server loads DB drivers before Sentry.init() · Issue #23876 · getsentry/sentry-javascript
Description: 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 pa...
Open Graph Description: 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...
X Description: 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/se...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/23876
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Nuxt dev server loads DB drivers before Sentry.init()","articleBody":"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.\n\nIt'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:\n\n```js\nimport './index.mjs'; // the whole Nitro dev server\n// … a few more imports …\nimport '…/node_modules/ioredis/built/index.js';\nimport '…/node_modules/mysql/index.js';\n// … more imports, then Sentry.init() somewhere inside\n```\n\nESM 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.\n\nThis isn't only about orchestrion. Anything that needs `Sentry.init()` to run before a dependency loads is unreliable in `nuxt dev`.\n\n**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.\n\nFound while working on JS-3233 (#22857). Blocks the nuxt-4 dev DB tests (#23836).","author":{"url":"https://github.com/chargome","@type":"Person","name":"chargome"},"datePublished":"2026-09-01T15:26:17Z","url":"https://github.com/getsentry/sentry-javascript/issues/23876"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e5a782d4-00f2-f1c3-bdad-c21da7828edf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB2A:BA36E:259A4:30388:6B042FD0 |
| html-safe-nonce | acb0f2305e554b7cbd412f94e2b017901f7558dadb1b3baf19118e6d3a82a65f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjJBOkJBMzZFOjI1OUE0OjMwMzg4OjZCMDQyRkQwIiwidmlzaXRvcl9pZCI6IjY5MTU5NTg2MDkwMDQ0NzQzMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1698f1920056a5ade82883558bc01226b57e0925bbc5c7c9ea275cf26c82a4ef |
| hovercard-subject-tag | issue:5313690029 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/23876/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d777b7b32650f378e2b7c2817bf416a7319d7d73a13a4f0ff7ee5a4479d4e8ed/getsentry/sentry-javascript/issues/23876 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d777b7b32650f378e2b7c2817bf416a7319d7d73a13a4f0ff7ee5a4479d4e8ed/getsentry/sentry-javascript/issues/23876 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chargome |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width