Skip to content

nuxt 3.12.3 stops working registering .mjs plugin (Nuxt 3.12.2 works) #28007

@userquin

Description

@userquin

Environment

npx nuxi info
Working directory: C:/temp-working/pwa/vite-pwa-nuxt-issue-146                                                                                         17:55:51
Nuxt project info:                                                                                                                                     17:55:51

------------------------------
- Operating System: Windows_NT
- Node Version:     v20.10.0
- Nuxt Version:     3.12.3
- CLI Version:      3.12.0
- Nitro Version:    2.9.7
- Package Manager:  [email protected]
- Builder:          -
- User Config:      compatibilityDate, devtools, typescript, modules
- Runtime Modules:  @vite-pwa/[email protected]
- Build Modules:    -
------------------------------

Reproduction

https://stackblitz.com/edit/github-j6cwz8-ft4vdx

Same reproduction can be found in vite-pwa-nuxt-issue-146 repo and the variant using the new pwa-icon plugin template in the fix branch.

Describe the bug

When Nuxt registers the pwa-icons.mjs plugin it breaks any other plugin failing in dev with typecheck enabled or during build (the editor fails to resolve the plugin, it has no types). The same reproduction using previous Nuxt 3.12.2 version works.

If we just add the .mjs extension in .nuxt/types/plugins.d.ts it works.

I'm moving the pwa-icon.mjs to plugin template generating the ts file, I have the pwa icon types also generated in #build/pwa-icons/pwa-icons:

Additional context

vite-pwa/nuxt#146

Error running dev with typecheck enabled
imagen

Error in build
imagen

Logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions