fix: Nuxt DevTools (vite-plugin-inspect) breaks oxc-walker's parseSync resolution, causing oxc-walker: could not resolve a parseSync implementation across many plugin transforms
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- nuxt, typescript, vite
- Ambito
- developer-experience, tooling
Direzione di ricerca
Inizia riproducendo il malfunzionamento nel Nuxt starter kit con DevTools abilitato usando npm run dev oppure npm run build. Traccia il percorso di trasformazione attraverso vite-plugin-inspect fino a oxc-walker's resolveParseSync e alla macro del compilatore keyed-functions di Nuxt; il lavoro è completato quando oxc-parser viene risolto correttamente e gli errori di trasformazione segnalati scompaiono senza disabilitare DevTools.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐛 The bug
Summary
When Nuxt DevTools is enabled, plugin/component transforms that rely on oxc-walker (via @unhead, Nuxt's internal keyed-functions compiler macro, nuxt-schema-org, nuxt-auth-sanctum, etc.) intermittently or consistently fail with:
oxc-walker: could not resolve a parseSync implementation. Install oxc-parser or rolldown (and use rolldown/utils), or pass a parseSync function via the parseAndWalk options.
Disabling DevTools (devtools: { enabled: false } in nuxt.config.ts) makes the error disappear entirely and permanently, across every environment we tested.
Environment
Nuxt: 4.4.8 and 4.5.2 (reproduced on both)
Vite: 7.3.6 and 8.2.2 (reproduced on both — not specific to Vite 8/Rolldown)
Node: v26.8.1
npm: 12.0.2
OS: macOS (Darwin 25.6.0), Apple Silicon (arm64)
oxc-parser: 0.147.0 (installed and working correctly when tested standalone via node -e "require('oxc-parser').parseSync")
oxc-walker: 1.1.1
Reproduction
Any Nuxt project with devtools enabled (the default) and any module that triggers oxc-walker-based static analysis on plugins/components (this reproduces even on the official Nuxt starter kit — no extra modules required beyond what DevTools itself needs).
Run npm run dev (or npm run build).
Errors/warnings appear referencing multiple internal Nuxt plugin files (payload.client.js, revive-payload.*.js, router.js, unhead.js, user components like AppFooter.vue, etc.), each pointing to oxc-walker's resolveParseSync.
Example full stack trace (dev mode, triggered from a Vue component via Nuxt's keyed-functions compiler macro):
[plugin:nuxt:compiler:keyed-functions] oxc-walker: could not resolve a parseSync implementation. Install oxc-parser or rolldown (and use rolldown/utils), or pass a parseSync function via the parseAndWalk options.
/path/to/project/app/components/app/AppFooter.vue
at resolveParseSync (node_modules/oxc-walker/dist/index.mjs:174:8)
at parseAndWalk (node_modules/oxc-walker/dist/index.mjs:196:29)
at TransformPluginContext.handler (node_modules/nuxt/dist/index.mjs:4754:29)
at async file:///.../node_modules/vite-plugin-inspect/dist/shared/vite-plugin-inspect.Fv_Ybe1l...
at async EnvironmentPluginContainer.transform (node_modules/@nuxt/vite-builder/node_modules/vite/dist/...)
at async loadAndTransform (node_modules/@nuxt/vite-builder/node_modules/vite/dist/...)
at async viteTransformMiddleware (node_modules/@nuxt/vite-builder/node_modules/vite/dist/...)
Note that vite-plugin-inspect (bundled with/used by Nuxt DevTools) sits directly in the transform call stack, between Vite's plugin container and the point where oxc-walker fails to resolve parseSync.
Expected behavior
oxc-walker should resolve parseSync from oxc-parser regardless of whether DevTools/vite-plugin-inspect is wrapping the transform pipeline.
Actual behavior
With DevTools enabled, oxc-walker's internal resolveParseSync() (which uses createRequire(import.meta.url) from its own module location) fails to locate oxc-parser, even though:
oxc-parser is correctly installed and resolvable via both require() and dynamic import() when tested standalone.
npm ls oxc-parser and npm ls oxc-walker show a single, deduplicated version each across the whole dependency tree.
This strongly suggests vite-plugin-inspect's transform wrapping changes the module context (e.g. import.meta.url, or how the transform function is invoked/bound) in a way that breaks oxc-walker's createRequire-based resolution of oxc-parser.
Confirmed fix
ts
// nuxt.config.ts
export default defineNuxtConfig({
devtools: { enabled: false },
})
After disabling DevTools and restarting the dev server (with .nuxt and node_modules/.vite cleared for good measure), the error disappears completely and does not return, across multiple terminal environments (plain Terminal.app and VS Code's integrated terminal) and across both a dev-only session and a build → dev cycle.
🛠️ To reproduce
🌈 Expected behavior
ℹ️ Additional context
p.s. bugreport generated with Claude AI.
- Lingua principale
- TypeScript
- Stelle
- 3.3k
- Fork
- 214
- Merge medio
- 19h 45m
- PR unite (30g)
- 12
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nuxt/devtools
-
fix: Inspect panel styles break when host page sets a custom html font-size (rem-based units) Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
feat: Nuxt devtools for AI Apertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
Tutte le issue di nuxt/devtools
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
TanStack/tanstack.com#1293 ·