Resolving TS2307 Error for Dynamic Component Imports in Nuxt 3
Any idea how I could potentially fix my
TS2307: Cannot find module
without using a ts-ignore? 😅 The components are not used normally and I get that they are throwing this error because I am not using them this way but in this dynamic way but there has to be a way to fix those without using a ts-ignore
?12 Replies
Could you solve it?
I have a similar problem but only in stories and tests in version 3.11.0
nope, just added ts-ignores for now but I don’t know how to fix that
Depending on how and where you created the component files, you might’ve to restart the server to help vscode find them
its webstorm and this error is there for like 2 months now (readded node modules and .nuxt like 100 times since), thats not the problem.
Oh okay
“Any idea how I could potentially fix my
TS2307: Cannot find module
[…]”
but thanks for trying to help anywayPretty sure that it is because of my usage of dynamic components ->
So have u resolved it?
Nope still having trouble with this
This right here would be a workaround but its not that smooth and doesnt fit for other areas with a lot more components :/
Hi, I am not sure if this would work for you, but in my case I had to do this
and when I had to use my component as a prop I used it with: markRaw(tenantForm)
JetBrains just released WebStorm v2024.1, they have done some things with the Vue language server and somehow after updating it worked 😅
I knew that it was because of my editor but I thought I could somehow declare it as right and defineAsyncComponent may work too but the update seems to have fixed it for now. Still thanks for your suggestion. 🙂