-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoimport components dir #13538
Comments
Same problem here. When extending another Nuxt instance (different Thrown error:
|
This may have been resolved by unjs/c12#8. You can pull in the fix by running Let me know if it resolves it for you, or provide a reproduction. 🙏 @johannschopplich As you are extending another config, note the breaking change in https://github.com/nuxt/framework/discussions/2883. |
I'm encountering a similar issue where component resolution is failing when using a non-default You can temporarily fix this by appending export default defineNuxtConfig({
srcDir: 'src/',
components: ['~/src/components']
}); |
@mihail727 do this instead for components: import { defineNuxtConfig } from 'nuxt3'
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
hooks: {
'components:dirs' (dirs) {
dirs.push({
path: '~/components'
})
}
},
components: {
global: true
},
}) @duckies yea I can also see this issue, in the stackblitz repo, use |
Have your tried to use the export default defineNuxtConfig({
components = {
dirs: [ '~/src/components' ]
}
}}; |
@teranode That works in my setup. Thanks! |
that works for me thanks |
@danielroe oh shit..... in another larger project, this solution did not work for |
For other people just coming here. The directories need to be part of the component names in the template. Eg:
Would be a DeleteButton.vue file in a profile directory. To disable this feature you can do:
|
Environment
Linux
v17.6.0
3.0.0-27458584.91fd16a
yarn@1.22.18
vite
privateRuntimeConfig
,app
,components
,nitro
,srcDir
,build
,buildModules
,modern
,tailwindcss
,meta
-
@nuxtjs/tailwindcss@5.0.2
Reproduction
--
Describe the bug
when i trying to start my project with new version of nuxt 3 i have error:
[Vue warn]: Failed to resolve component: NavLink If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. Invalid value used as weak map key
my
nuxt.config.ts
:Additional context
Logs
The text was updated successfully, but these errors were encountered: