Open markbrockhoff opened 2 months ago
It looks like the nuxt cli bundler can't resolve the required vite/client
(ref) dependency during nuxt prepare:types
– if you are using pnpm without hoisting or installing vite
as a project dep first.
A temporary workaround is to add the follow hoisting pattern to /.npmrc
public-hoist-pattern[]=vite
Then reinstall the project deps and rebuild the types:
pnpm i
Environment
Darwin
v20.11.0
3.12.3
3.12.0
2.9.7
pnpm@9.4.0
-
compatibilityDate
,devtools
,typescript
-
-
Reproduction
https://github.com/markbrockhoff/nuxt-vite-types-bug-repro
Describe the bug
Right now typescript will complain when trying to use raw or url imports (Docs):
For projects using vite as a bundler I'd expect that vites' types are included within the types generated by nuxt so that these kinds of imports work out of the box.
Additional context
If I understood it correctly, this should have been added by #19338 already. That's why I'm opening this as a bug and not a feature request. Please correct me if I'm mistaken. It also seems like there is an ongoing discussion regarding this, which didn't get that much attention so far: #19694
Logs
No response