Repository navigation
fix(nuxt): Keep storage instrumentation plugin synchronous - #25949
Conversation
size-limit report 📦Compared: 081f440 (PR test merge using develop at 8d6b875) Against: 8d6b875 (develop) · base run #64749 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 3 successful. See the run.
Successful checks
|
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>
24d8402 to
ac1c310
Compare
chargome
left a comment
There was a problem hiding this comment.
Is changing this export type breaking?
|
@chargome re "Is changing this export type breaking?": no. |
Why: The optional
nuxt-5E2E job broke whennitro@latestmoved from3.0.260903-betato3.0.261029-rc. The same develop SHA passed before that release and failed after it. Two separate Nitro changes caused it:asyncbut 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. OuronUnhandledRejectionhandler keeps the process running, so instead of exiting with code 1 the server keeps listening behind a rejectedreadygate. Making the plugin synchronous restores the old behavior. Nitro v2 never awaited plugins, so nothing changes there.defineCachedFunction/defineCachedHandlerare now built onocache, and the defaultmemorycache driver skips KV storage completely. The storage instrumentation can't see those calls anymore. The test app now setscache: { driver: 'kv' }, which is also what Nitro picks by default when acacheKV 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 ofnitro:functions:...), so the expired-entry check inisCacheHitno 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]