Skip to content

fix(nuxt): Keep storage instrumentation plugin synchronous - #25949

Draft
sentry-junior[bot] wants to merge 1 commit into
developfrom
fix/nuxt-5-nitro-rc
Draft

sentry-junior[bot] wants to merge 1 commit into
developfrom
fix/nuxt-5-nitro-rc

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Why: The optional nuxt-5 E2E job broke when nitro@latest moved from 3.0.260903-beta to 3.0.261029-rc. The same develop SHA passed before that release and failed after it. Two separate Nitro changes caused it:

  • Nitro now awaits async plugins and runs every later plugin after that promise settles. Our storage plugin was async but never awaited anything, so it pushed every plugin after it (including user plugins) into the async path. A plugin that throws at startup then turns into an unhandled rejection. Our onUnhandledRejection handler keeps the process running, so instead of exiting with code 1 the server keeps listening behind a rejected ready gate. Making the plugin synchronous restores the old behavior. Nitro v2 never awaited plugins, so nothing changes there.
  • Nitro's defineCachedFunction / defineCachedHandler are now built on ocache, and the default memory cache driver skips KV storage completely. The storage instrumentation can't see those calls anymore. The test app now sets cache: { driver: 'kv' }, which is also what Nitro picks by default when a cache KV mount is configured, so cache instrumentation stays tested.

Unsure about: With Nitro v3 RC's default config, users no longer get cache.* spans for cached functions or handlers. Supporting that would need new instrumentation around ocache's storage, since there is no tracing channel for it. Cache keys also changed shape (nitrofunctions.<hash>:... instead of nitro:functions:...), so the expired-entry check in isCacheHit no longer runs, and it falls back to checking whether a value is present. Should that be handled here, or tracked as a follow-up?

via Francesco Gringl-Novy.

--

View Session [Sentry]

Nitro v3 RC awaits async plugins and defers every later plugin until the
promise settles. Our async (but never awaiting) storage plugin turned all
subsequent plugins async, so a plugin throwing at startup became an
unhandled rejection instead of crashing the server.

Also opt the nuxt-5 e2e app into the `kv` cache driver: Nitro v3 RC's
default `memory` cache driver no longer goes through KV storage, so cached
functions/handlers are not visible to the storage instrumentation.

Co-Authored-By: Francesco Gringl-Novy <francesco.novy@sentry.io>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 470c120 (PR test merge using develop at 7aca628)

Against: 7aca628 (develop) · base run #64423

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

Path Size % Change Change
@sentry/browser 30.39 kB - -
@sentry/browser - with treeshaking flags 28.53 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.42 kB - -
@sentry/browser (incl. Tracing) 52.7 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.71 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.68 kB - -
@sentry/browser (incl. Tracing, Replay) 93.01 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.6 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.75 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.74 kB - -
@sentry/browser (incl. Feedback) 47.97 kB - -
@sentry/browser (incl. sendFeedback) 35.49 kB - -
@sentry/browser (incl. FeedbackAsync) 40.6 kB - -
@sentry/browser (incl. Metrics) 31.42 kB - -
@sentry/browser (incl. Logs) 31.72 kB - -
@sentry/browser (incl. Metrics & Logs) 32.44 kB - -
@sentry/react 32.27 kB - -
@sentry/react (incl. Tracing) 55.07 kB - -
@sentry/vue 38.66 kB - -
@sentry/vue (incl. Tracing) 55.72 kB - -
@sentry/svelte 30.42 kB - -
@sentry/remix (Remix 3 client bundle) 57.79 kB - -
CDN Bundle 32.18 kB - -
CDN Bundle (incl. Tracing) 53.23 kB - -
CDN Bundle (incl. Logs, Metrics) 34.45 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.17 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.86 kB - -
CDN Bundle (incl. Tracing, Replay) 91.44 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.56 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.55 kB - -
CDN Bundle - uncompressed 94.62 kB - -
CDN Bundle (incl. Tracing) - uncompressed 157.58 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.09 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.31 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.65 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 279.27 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 284.99 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.97 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 298.69 kB - -
@sentry/nextjs (client) 57.87 kB - -
@sentry/sveltekit (client) 53.22 kB - -
@sentry/core/server 44.24 kB - -
@sentry/core/browser 13.93 kB - -
@sentry/node 154.94 kB +0.02% +17 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.08 kB - -
@sentry/node - without tracing 96.23 kB +0.03% +21 B 🔺
@sentry/node - without channel injection 135.33 kB +0.02% +14 B 🔺
@sentry/aws-serverless 104.42 kB +0.03% +27 B 🔺
@sentry/cloudflare (withSentry) - minified 197.91 kB - -
@sentry/cloudflare (withSentry) 491.89 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 218.34 kB - -

View base workflow run

@github-actions

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 4 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 22s Details

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.

0 participants