#Resolving TS2307 Error for Dynamic Component Imports in Nuxt 3

1 messages · Page 1 of 1 (latest)

hot forge
#

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?

rain kraken
#

Could you solve it?

I have a similar problem but only in stories and tests in version 3.11.0

hot forge
topaz hinge
#

what's the error when you mouse over?

latent dagger
#

Depending on how and where you created the component files, you might’ve to restart the server to help vscode find them

hot forge
latent dagger
#

Oh okay

hot forge
hot forge
topaz hinge
#

can't really say without a reproduction

#

not sure why your components are throwing that or what you're doing elsewhere

hot forge
#

Pretty sure that it is because of my usage of dynamic components ->

<component :is="currentStep" @next="nextStep" @prev="prevStep" class="bg-neutral-900" />
latent dagger
#

So have u resolved it?

hot forge
hot forge
winter mirage
#

Hi, I am not sure if this would work for you, but in my case I had to do this

const tenantForm = defineAsyncComponent(() => import('~/components/dialog/Tenant.vue'))

and when I had to use my component as a prop I used it with: markRaw(tenantForm)