Nuxt · Modules
NUXT0083Import Nuxt helpers explicitly in module runtime files
Finds runtime files of a published Nuxt module package that call Nuxt, Vue, Nitro, or h3 auto-imports without importing them.
vite-doctor/nuxtmoduleserrorAuto-fix
Why it happens
Nuxt and Nitro skip auto-import transforms for files inside node_modules, where a published module's runtime directory lives. The module playground links the source, so auto-imports work during development and the missing import only fails as a ReferenceError in projects that install the module. Doctor checks files under the runtime directory next to the module entry, such as src/runtime/, and skips local modules and packages that are also Nuxt layers because Nuxt still transforms those.
Fix
Import runtime helpers explicitly from #imports, or from their source package such as vue or h3.
Example
Import runtime helpers in a module plugin
Before
// src/runtime/plugin.ts
export default defineNuxtPlugin(() => {
const config = useRuntimeConfig()
})
After
// src/runtime/plugin.ts
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
export default defineNuxtPlugin(() => {
const config = useRuntimeConfig()
})
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/module/explicit-runtime-imports