nuxt / nuxt/module-builder

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

Open Beginner friendly
#720 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
275
Forks
35
Avg merge
4h 42m
Merged PRs (30d)
6

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated playground/package.json and compare its dependency entry with the npm reproduction steps. Verify the generated package points to the local module, then run npm run dev and confirm that the plugin from src/runtime/plugin.ts is injected and myModule is no longer ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.