Skip to content

chore: change name to @vite-pwa/nuxt in module meta - #225

Merged
danielroe merged 1 commit into
vite-pwa:mainfrom
igorexa34314:change-module-name
Feb 6, 2026
Merged

chore: change name to @vite-pwa/nuxt in module meta#225
danielroe merged 1 commit into
vite-pwa:mainfrom
igorexa34314:change-module-name

Conversation

@igorexa34314

@igorexa34314 igorexa34314 commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Description

The module name must be the same as the npm package name, otherwise we cannot include it in moduleDependencies (read docs)

With the current name it hints pwa field

image


Which leads to an error if we try to add pwa to moduleDependencies

Could not load pwa. Is it installed?


Renaming module to @vite-pwa/nuxt solves the problem.

image

Tip

The author of this PR can publish a preview release by commenting /publish below.

Copilot AI review requested due to automatic review settings February 6, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request changes the module's meta name from 'pwa' to '@vite-pwa/nuxt' to match the npm package name. This is required for proper integration with Nuxt's moduleDependencies feature, which allows other modules to declare dependencies on this module. Without this change, attempting to reference the module in moduleDependencies fails because Nuxt cannot find a module named 'pwa'.

Changes:

  • Updated the module meta name to '@vite-pwa/nuxt' while preserving the 'pwa' configKey for backward compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danielroe
danielroe merged commit 2ab646a into vite-pwa:main Feb 6, 2026
6 of 7 checks passed
@igorexa34314

igorexa34314 commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

@danielroe I think it's also a flaw inside Nuxt core because it augments typings for moduleDependencies by name defined in module meta while I think they are actually resolved by the key from modules array inside nuxt.config.ts

I have a nuxt app with a bunch of modules and most of them (every one highlighted in red, whose names are not identical to the name of npm package, including local ones) throws an error when referencing inside moduleDependencies.

image

@danielroe

Copy link
Copy Markdown
Collaborator

@igorexa34314 can you try with latest nuxt nightly version?

@igorexa34314

Copy link
Copy Markdown
Contributor Author

@igorexa34314 can you try with latest nuxt nightly version?

@danielroe Still not working.


With @vueuse/nuxt (hints vueuse in moduleDependencies) specified as a dependency.

 ERROR  Could not load vueuse. Is it installed?                                                                                                                                          13:16:28  

    at loadNuxtModuleInstance (/C:/projects/raumkonzept-schweiz-website-next/node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:808:8)
    at installModules (/C:/projects/raumkonzept-schweiz-website-next/node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:615:21)
    at async initNuxt (/C:/projects/raumkonzept-schweiz-website-next/node_modules/nuxt/dist/index.mjs:5774:3)
    at async #initializeNuxt (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/dist/dev-DYBZ0sVr.mjs:492:3)
    at async NuxtDevServer.init (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/dist/dev-DYBZ0sVr.mjs:384:3)
    at async initialize (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/dist/dev-DYBZ0sVr.mjs:685:2)
    at async Object.run (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/dist/dev-CJ7lmzuV.mjs:205:51)
    at async runCommand (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/node_modules/citty/dist/index.mjs:196:47)
    at async runCommand (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/node_modules/citty/dist/index.mjs:193:21)
    at async runMain (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/node_modules/citty/dist/index.mjs:304:10)

  [cause]: Could not resolve vueuse (specified as a dependency of C:/projects/raumkonzept-schweiz-website-next/packages/app/modules/extend-vueuse.ts).


With local module specified as a dependency.

 ERROR  Could not load local-module. Is it installed?                                                                                                                                    13:22:02  

    at loadNuxtModuleInstance (/C:/projects/raumkonzept-schweiz-website-next/node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:808:8)
    at installModules (/C:/projects/raumkonzept-schweiz-website-next/node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:615:21)
    at async initNuxt (/C:/projects/raumkonzept-schweiz-website-next/node_modules/nuxt/dist/index.mjs:5774:3)
    at async #initializeNuxt (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/dist/dev-DYBZ0sVr.mjs:492:3)
    at async NuxtDevServer.init (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/dist/dev-DYBZ0sVr.mjs:384:3)
    at async initialize (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/dist/dev-DYBZ0sVr.mjs:685:2)
    at async Object.run (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/dist/dev-CJ7lmzuV.mjs:205:51)
    at async runCommand (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/node_modules/citty/dist/index.mjs:196:47)
    at async runCommand (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/node_modules/citty/dist/index.mjs:193:21)
    at async runMain (/C:/projects/raumkonzept-schweiz-website-next/node_modules/@nuxt/cli/node_modules/citty/dist/index.mjs:304:10)

  [cause]: Could not resolve local-module (specified as a dependency of C:/projects/raumkonzept-schweiz-website-next/packages/app/modules/extend-local-module.ts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants