You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am taking over a post-migration Nuxt project (2.15 -> 3+) in which each component is imported manually. I wanted to change this, but my components that were auto-imported were not recognised by Nuxt. They were getting the error (property) ComponentName: unknown, and were not being highlighted. The problem was this "types" property in ts.config. "types": ["@nuxt/types", "@nuxtjs/i18n"].
But as you can see, there is "@nuxtjs/i18n" in "types" in ts.config which is also implemented in the project, but it is not used anywhere, except that we have its types in "types".
When I remove the "types" property, the auto-import of the components works correctly, they highlight, its props are displayed, etc. And that is OK, that is what I wanted.
BUT...
When I uninstalled"@nuxtjs/i18n" which is not used anyway, my $t in <template> throws the error '__VLS_ctx.$t' is of type 'unknown'.ts(18046). So the only problem remains vue-i18n which is implemented according to Vue-i18n - Nuxt 3
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Setup:
From the beggining.
I am taking over a post-migration Nuxt project (2.15 -> 3+) in which each component is imported manually. I wanted to change this, but my components that were auto-imported were not recognised by Nuxt. They were getting the error
(property) ComponentName: unknown
, and were not being highlighted. The problem was this"types"
property ints.config
."types": ["@nuxt/types", "@nuxtjs/i18n"]
.The project is configured with vue-i18n:
But as you can see, there is
"@nuxtjs/i18n"
in"types"
ints.config
which is also implemented in the project, but it is not used anywhere, except that we have its types in"types"
.When I remove the
"types"
property, the auto-import of the components works correctly, they highlight, its props are displayed, etc. And that is OK, that is what I wanted.BUT...
When I uninstalled
"@nuxtjs/i18n"
which is not used anyway, my$t
in<template>
throws the error'__VLS_ctx.$t' is of type 'unknown'.ts(18046)
. So the only problem remainsvue-i18n
which is implemented according to Vue-i18n - Nuxt 3Beta Was this translation helpful? Give feedback.
All reactions