You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting from nuxt 3.5.0, plugins created by template (addPluginTemplate / addTemplate -> addPlugin) don't get registered to .nuxt/types/plugins.d.ts when generated inside the .nuxt folder.
As we can see from the reproduction repo, the InjectionType<typeof import("../plugins/hello").default> is missing from the plugins.d.ts.
It causes the useNuxtApp().$hello type to be unknown.
Additional context
If we generate the template outside the .nuxt folder, it requires running nuxi prepareat least twice to make it registered to .nuxt/types/plugins.d.ts.
Environment
Linux
v16.20.0
3.6.5
2.5.2
npm@9.4.2
vite
modules
./modules/hello.ts
-
Reproduction
https://stackblitz.com/edit/nuxt-starter-avmg3e
Run:
nuxi prepare
Describe the bug
Starting from nuxt
3.5.0
, plugins created by template (addPluginTemplate
/addTemplate
->addPlugin
) don't get registered to.nuxt/types/plugins.d.ts
when generated inside the.nuxt
folder.As we can see from the reproduction repo, the
InjectionType<typeof import("../plugins/hello").default>
is missing from theplugins.d.ts
.It causes the
useNuxtApp().$hello
type to beunknown
.Additional context
If we generate the template outside the
.nuxt
folder, it requires runningnuxi prepare
at least twice to make it registered to.nuxt/types/plugins.d.ts
.Reproduction: https://stackblitz.com/edit/nuxt-starter-9mc6yi
Logs
No response
The text was updated successfully, but these errors were encountered: