Description
When scaffolding a new Nuxt module with npm create nuxt -- -t module my-module and using npm (not pnpm),
the playground cannot resolve the local module, causing the plugin to never be injected and myModule
to be ignored in nuxt.config.ts — with no error in the console.
Root cause
The generated playground/package.json has:
"dependencies": {
"my-module": "latest"
}
Steps to reproduce
npm create nuxt -- -t module my-module
cd my-module
npm run dev
- Plugin from
src/runtime/plugin.ts is never injected — no error shown
Fix
Change playground/package.json to use "file:..":
"dependencies": {
"my-module": "file:.."
}
Environment
- npm: 11.10.0
- nuxt: 4.3.1
- @nuxt/module-builder: 1.0.2
- OS: Windows 11
Description
When scaffolding a new Nuxt module with
npm create nuxt -- -t module my-moduleand using npm (not pnpm),the playground cannot resolve the local module, causing the plugin to never be injected and
myModuleto be ignored in
nuxt.config.ts— with no error in the console.Root cause
The generated
playground/package.jsonhas:Steps to reproduce
npm create nuxt -- -t module my-modulecd my-modulenpm run devsrc/runtime/plugin.tsis never injected — no error shownFix
Change
playground/package.jsonto use"file:..":Environment