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
Auto-import engine treats non-component files as components #15447
Comments
This should be resolved in the edge channel, or in the next RC via nuxt/framework#8787. Let me know if not and I'll reopen. |
@danielroe if this is the only MR related, then I can already say that it will not help. I also updated the reproduction to use Nuxt from the Edge channel, and this is still an issue. I made a picture with points of attention to make it easier to understand what I'm talking about: |
Ah. If you are placing export default defineNuxtConfig({
components: [
{
path: '~/components',
extensions: ['.vue']
}
]
}) |
@danielroe thanks, it solves the problem. I noticed it's not documented anywhere. Do you need a docs update in that part? |
That would be very welcome - thank you. |
Environment
No matter
Reproduction
https://stackblitz.com/edit/github-g7riij?file=nuxt.config.ts
Run
npm run dev
and check the console.There are three "components" registered, but actually only one of them is a Vue component.
Describe the bug
The auto-import engine treat any (?)
vue
/ts
file as component and register it.However, developers may put the types alongside the component, or even they want to put any other file with logic related to component for decomposition purposes.
There should be a more robust check if the file is really a Vue component.
As I can see it breaks nothing but autocomplete..
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: