nuxt: Auto import of components broken
Environment
- Operating System:
Linux - Node Version:
v16.14.0 - Nuxt Version:
3.0.0-27429889.e45a780 - Package Manager:
yarn@1.22.17 - Bundler:
Vite - User Config:
- - Runtime Modules:
- - Build Modules:
-
Reproduction
https://github.com/jiblett1000/test
Describe the bug
With the latest update on npm as of this writing, auto importing of components seems to be completely broken. I’ve linked a reproduction with a fresh nuxt3 install with a single component in the components directory. Running yarn dev results in this error:
[Vue warn]: Failed to resolve component: Test If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
Additional context
No response
Logs
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 13
- Comments: 16 (4 by maintainers)
This error was driving me crazy, good thing that I decided to search on GitHub issues and not give up on it 😂
or you can temporarily just add those lines in your nuxt.config it should work
Glad to see its not only me.
This isn’t a dependency issue - it’s resolved by https://github.com/nuxt/framework/pull/3396, and you can work around for the moment by configuring
components: { global: true }. Make sure to revert that change after that PR is merged.@smorcuend this work for me, thanks!
Problem solved! I deleted the node_modules directory, package-lock.json and the npm cache and reinstalling the npm packages the problem went away.
Thanks! Adding the
dirsoption seems to do the trick. 👍