Skip to content

npm run dev fails silently when using npm — playground package.json uses "my-module": "latest" instead of "file:.." #720

@Phenix333

Description

@Phenix333

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

  1. npm create nuxt -- -t module my-module
  2. cd my-module
  3. npm run dev
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions