Nuxt · Plugins

NUXT0041Nested plugins are not auto-registered by default

Flags subdir auto registration assumption in Nuxt plugins code before it leaks into runtime behavior.

Why it happens

Vite configuration runs in both dev and build pipelines. Narrow, explicit settings reduce surprises across SSR, workers, and local file access.

Fix

Remove subdir auto registration assumption, or move it to the Nuxt runtime/API that owns that behavior.

Example

Register nested plugins explicitly

Before

// app/plugins/nested/analytics.ts
export default defineNuxtPlugin(() => {})

After

export default defineNuxtConfig({
  plugins: ['~/app/plugins/nested/analytics'],
})

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm nuxt doctor --rules nuxt/plugins/no-subdir-auto-registration-assumption
Copyright © 2026