Nuxt · NUXT0082
Resolve module runtime paths with createResolver
Finds relative string paths passed to @nuxt/kit helpers such as addPlugin, addComponent, addComponentsDir, addImportsDir, addServerHandler, addServerPlugin, and addLayout in Nuxt module code.
nuxt/module/resolve-runtime-pathssrc/rule-packs/nuxt/rules/nuxt/module-resolve-runtime-paths.ts Upstream docs Run this rule
pnpm nuxt doctor --rules nuxt/module/resolve-runtime-paths
Why it matters
@nuxt/kit does not resolve relative paths against the module file. Nuxt resolves them later against the consuming project's rootDir or the process working directory, so a module that works in its playground breaks once it is installed from node_modules. createResolver(import.meta.url) resolves paths from the module file instead. For local modules in modules/, Doctor only reports paths that exist next to the module and not in the project.
Recommended fix
Create a resolver with createResolver(import.meta.url) and pass resolver.resolve('./runtime/...') to kit helpers.
Useful links
Example
Resolve runtime paths from the module file
Before
addPlugin('./runtime/plugin')
After
const resolver = createResolver(import.meta.url)
addPlugin(resolver.resolve('./runtime/plugin'))