Nuxt · NUXT0059

Keep shared code runtime-neutral

Flags vue or nitro context in shared in Nuxt shared code before it leaks into runtime behavior.
NUXT0059vite-doctor/nuxtarchitectureerrorSuggestion

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.

Remove vue or nitro context in shared, or move it to the Nuxt runtime/API that owns that behavior.

Example

Keep shared utilities runtime-neutral

Before

export function currentPath() {
  return useRoute().path
}

After

export function currentPath(path: string) {
  return path
}
Copyright © 2026