Nuxt · Modules

NUXT0082Resolve 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.

Why it happens

@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.

Fix

Create a resolver with createResolver(import.meta.url) and pass resolver.resolve('./runtime/...') to kit helpers.

Example

Resolve runtime paths from the module file

Before

addPlugin('./runtime/plugin')

After

const resolver = createResolver(import.meta.url)
addPlugin(resolver.resolve('./runtime/plugin'))

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/resolve-runtime-paths
Copyright © 2026