Nuxt · NUXT0059
Keep shared code runtime-neutral
Flags vue or nitro context in shared in Nuxt shared code before it leaks into runtime behavior.
nuxt/shared/no-vue-or-nitro-context-in-sharedsrc/rule-packs/nuxt/rules/nuxt/no-vue-or-nitro-context-in-shared.ts Upstream docs Run this rule
pnpm nuxt doctor --rules nuxt/shared/no-vue-or-nitro-context-in-shared
Why it matters
Nuxt gives this pattern a specific contract. Staying inside that contract makes the code easier to test, refactor, and run across server and client runtimes.
Recommended fix
Remove vue or nitro context in shared, or move it to the Nuxt runtime/API that owns that behavior.
Useful links
Example
Keep shared utilities runtime-neutral
Before
export function currentPath() {
return useRoute().path
}
After
export function currentPath(path: string) {
return path
}