deps: upgrade to nuxt-nightly (5x) and vite ^8.1 - #1048
Conversation
Bumps nuxt to npm:nuxt-nightly@5x and vite to ^8.1.5 (removing the prior ~8.0.16 pin, which existed only because @vitejs/devtools 0.4.2 broke under vite 8.1's WebSocket-upgrade handling — no longer reproducible against the current @vitejs/devtools 0.4.9 e2e SSR suite). Nuxt 5 nightly builds on the next-gen Nitro v3 engine (package `nitro`, not `nitropack`), which required several compatibility fixes: - `unplugin-vue-markdown`'s vite plugin now needs `prepend: true` when registered via `addVitePlugin`, since Nuxt's non-isomorphic plugin wrapping otherwise hard-codes `enforce: 'post'`, discarding the plugin's own `enforce: 'pre'` and breaking `.md` SFC compilation. - The DevTools storage browser rebuilds its own `unstorage` instance from `nitro.options.storage`/`devStorage` instead of reading `nitro.storage`, which Nitro v3 no longer exposes (storage is now a build-time virtual module). This was crashing SSR prerendering with 500s under Nitro v3. `server-routes`/`server-tasks` similarly move from watching the (now gone) internal `src` storage mount to Nitro's `dev:reload` hook. `data-inspector`, `module-main`, and `runtime/nitro/inline` are updated for the Nitro v2/v3 union types Nuxt 5's hooks now carry. - The Components tab's built-in-vs-library grouping recognized only the literal `nuxt` package name; `nuxt-nightly` (and the older `nuxt-edge` alias) are now recognized too. - Pin `vue-sfc-transformer` to what `@nuxt/module-builder`'s bundled `mkdist` actually depends on (`^0.1.17`) — `resolutionMode: highest` otherwise hoists it to module-builder's own newer want, and mkdist's `.vue` transform silently breaks under that mismatch, writing compiled output into `packages/devtools/src/runtime/**` instead of `dist/`. Known remaining issue: `floating-vue`'s globally-registered `<VDropdown>` fails to render its scoped-slot content under this stack (upstream, unresolved — Akryum/floating-vue#924, #1085), so component/composable/route names inside their dropdown triggers don't render in the DevTools UI. The underlying data is unaffected; this is UI-only and tracked as a follow-up. pnpm build, pnpm typecheck, pnpm lint, and pnpm test all pass. This upgrade was done with the help of an AI agent.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe devtools updates add Nuxt package-name recognition for nightly and edge installs, prepend the client markdown Vite plugin, and adjust an error type assertion. Server API and task modules receive explicit h3 and Nitro registrations. Nitro compatibility types now cover Nitro v2 and v3, with updated lifecycle refresh handling, configuration injection, storage reconstruction, and task normalization. Workspace and package metadata advance Nuxt, Nitro, Vite, and related pins. Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@nuxt/devtools and @nuxt/devtools-kit only ever consume one or the other at runtime (whichever Nitro engine the consumer's own Nuxt resolves), so declare both as optional peerDependencies rather than as plain dependencies of the published package. This monorepo still pins a devDependency on each (via the shared catalog) so its own build and typecheck resolve a single, consistent version of both instead of whatever `autoInstallPeers` would otherwise pick independently. devtools-kit only type-imports from `nitropack` (not `nitro/types`), so it only declares the `nitropack` peer.
Summary
Upgrades
nuxttonpm:nuxt-nightly@5xandviteto^8.1.5, removing theprior
~8.0.16pin. That pin existed only because@vitejs/devtools@0.4.2broke under Vite 8.1's reworked WebSocket-upgrade handling; against the
current
@vitejs/devtools@0.4.9the SSR e2e suite no longer reproduces thatcrash.
Nitro v3 compatibility
Nuxt 5 nightly's Nitro layer (
@nuxt/nitro-server-nightly) builds on thenext-gen Nitro v3 engine (package
nitro, notnitropack), which is abigger jump than a version bump — several DevTools internals depended on
Nitro v2-only APIs:
nitro.storageis gone. Nitro v3 no longer exposes a liveunstorageinstance on the Nitro object (storage mounts are now a build-time virtual
module consumed from inside the built server). The DevTools storage
browser (
server-rpc/storage.ts) now builds its ownunstorageinstancefrom
nitro.options.storage/devStorage, mirroring whatnitropackitself used to do internally. Without this, SSR prerendering crashed with
500s on every route.
server-routes/server-tasksused to watch Nitro's internalsrcstorage mount (also gone) to detect new route/task files; they now use
Nitro's
dev:reloadhook, which exists on both engines.data-inspector,module-main, andruntime/nitro/inlineare updatedfor the Nitro v2/v3 union types Nuxt 5's hooks now carry (
nitro:init,nitro:build:before,nitro:configcan all receive either engine).Other fixes along the way
unplugin-vue-markdown's Vite plugin needsprepend: truewhenregistered via
addVitePluginnow — Nuxt's non-isomorphic pluginwrapping hard-codes
enforce: 'post'otherwise, discarding the plugin'sown
enforce: 'pre'and breaking.mdSFC compilation in the DevToolsclient itself.
literal
nuxtpackage name;nuxt-nightly(and the oldernuxt-edgealias) are now recognized too, since aliased installs physically live
under a different
node_modulesname.vue-sfc-transformerto^0.1.17, matching what@nuxt/module-builder's bundledmkdistitself depends on —resolutionMode: highestotherwise hoists it to module-builder's ownnewer want, and mkdist's
.vuetransform silently breaks under thatmismatch (it was writing compiled output into
packages/devtools/src/runtime/**instead ofdist/, clobberingauth/index.htmlin the process).Known remaining issue (not blocking)
floating-vue's globally-registered<VDropdown>fails to render itsscoped-slot content under this stack — verified via a live e2e repro, not
present on
main(stable Nuxt 4). This is an upstream, already-openfloating-vue bug unrelated to how it's used here (Akryum/floating-vue#924,
#1085). Effect: component/composable/route names inside their dropdown
trigger don't render in the DevTools UI (the underlying list/count data is
correct). Filed as a follow-up rather than fixed here, since root-causing it
further is a floating-vue/Vue-core investigation, not a DevTools change.
Verification
pnpm build,pnpm typecheck,pnpm lint,pnpm test(lint + unit) allpass.
pnpm test:e2e:dev(emptyplayground) passes except for thefloating-vue issue above.
This upgrade was done with the help of an AI agent.