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
We created a simple landing page that displays countries defined in a Vue-i18n language.json file. This works fine but we get the following TypeScript errors:
[vue-tsc] Property 'code' does not exist on type 'never'.
[vue-tsc] Property 'name' does not exist on type 'never'.
It seems like the properties of a country are not found in the .json file. Although we did define the MessageSchema to be enUS, as described in the official documentation. For other strings in the lang.json files, there are no errors, only with a list or array it does not seem to default to String.
importenUSfrom'src/i18n/en-US.json'importnlBEfrom'src/i18n/nl-BE.json'exportdefaultboot(({ app })=>{// Type-define 'enUS' as the master schema for the resourcetypeMessageSchema=typeofenUSconsti18n=createI18n<[MessageSchema],'en-US'|'nl-BE'>({legacy: false,locale: Quasar.lang.getLocale(),fallbackLocale: 'en-US',messages: {'en-US': enUS,'nl-BE': nlBE},})app.use(i18n)})
Reporting a bug?
We created a simple landing page that displays countries defined in a Vue-i18n
language.json
file. This works fine but we get the following TypeScript errors:It seems like the properties of a country are not found in the
.json
file. Although we did define theMessageSchema
to beenUS
, as described in the official documentation. For other strings in thelang.json
files, there are no errors, only with a list or array it does not seem to default toString
.Please find a CodeSandBox for testing here. Below you can find the most important files.
File 'en-US.json'
File '/boot/i18n.ts'
File 'LandingPage.vue'
This might be related to #91
Expected behavior
No TS errors
Reproduction
See this CodeSandBox for testing.
System Info
Screenshot
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: