N
Nuxt4mo ago
Lucy

Type recognised everywhere but the component

I declared an interface in the /types directory. I can use this type in app.vue and under /pages. However, when I use it in a component, I get: Unresolvable type reference or unsupported built-in utility type. Here is a stackblitz replicating the issue: https://stackblitz.com/edit/github-o4bvcj?file=app.vue If you comment out the usage of the TileData type in the component it starts to work again even though it's still used in app.vue
3 Replies
Lucy
Lucy4mo ago
I found this https://github.com/vuejs/core/issues/8612#issuecomment-1600030885 but when I add this to my nuxt config, I get : Internal server error: Failed to load TypeScript, which is required for resolving imported types. Please make sure "typescript is installed as a project dependency.
ExEr7um
ExEr7um4mo ago
try to remove declare
Lucy
Lucy4mo ago
that wasn't it but changing from
defineProps<Interface>()
defineProps<Interface>()
to
defineProps<{interface: Interface}>()
defineProps<{interface: Interface}>()
worked for some reason
Want results from more Discord servers?
Add your server