chore: change name to @vite-pwa/nuxt in module meta - #225
Conversation
There was a problem hiding this comment.
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 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 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
|
|
@igorexa34314 can you try with latest nuxt nightly version? |
@danielroe Still not working.
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).
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). |

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
pwafieldWhich leads to an error if we try to add
pwatomoduleDependenciesCould not load pwa. Is it installed?Renaming module to
@vite-pwa/nuxtsolves the problem.Tip
The author of this PR can publish a preview release by commenting
/publishbelow.