N
Nuxtβ€’5mo ago
Reeed

vscode complains about auto imports

there is a utils/index.ts in my project, i know it would be auto imported into my vue components and it works fine, but the vscode would complain about it like this:
Property 'toLocal' does not exist on type 'CreateComponentPublicInstanceWithMixins<ToResolvedProps<{ course: CourseExt; }, {}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 18 more ..., {}>'.
Property 'toLocal' does not exist on type 'CreateComponentPublicInstanceWithMixins<ToResolvedProps<{ course: CourseExt; }, {}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 18 more ..., {}>'.
where toLocal is the helper function in the utils/index.ts file, how can i fix this?
18 Replies
Dawit
Dawitβ€’5mo ago
You might need to run the npm run prepare or npx nuxi prepare command to generate the types from your files. It's probably defined in your package.json.
Reeed
ReeedOPβ€’5mo ago
doesn't work for me
hiimmox
hiimmoxβ€’5mo ago
try reloading vscode
Reeed
ReeedOPβ€’5mo ago
still no work also i notice that if i use the util function in the script section, vscode wouldn't complain it would complain when i use them in the template
Dawit
Dawitβ€’5mo ago
@kapa.ai Hopefully can help πŸ‘€πŸ˜„
kapa.ai
kapa.aiβ€’5mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I apologize, but I'm not able to provide a helpful answer based on that brief statement. As an AI assistant specialized in answering questions about Nuxt, I'm designed to respond to specific questions or inquiries related to Nuxt development, features, configuration, etc. If you have a particular question about Nuxt, I'd be happy to try and assist you with that. Could you please provide more details or ask a specific question about Nuxt? ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.aiβ€’5mo ago
<@1000169766939529309> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Dawit
Dawitβ€’5mo ago
Turns out not.
Reeed
ReeedOPβ€’5mo ago
😦
Cue
Cueβ€’5mo ago
Are you using Vue Official extension? If so what version?
hiimmox
hiimmoxβ€’5mo ago
Did you modify your tsconfig?
Reeed
ReeedOPβ€’5mo ago
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"noUncheckedIndexedAccess": true
}
}
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"noUncheckedIndexedAccess": true
}
}
this is my tsconfig yes its 2.1.8
Cue
Cueβ€’5mo ago
@Reeed could you provide a list of modules you have installed in your Nuxt config?
Reeed
ReeedOPβ€’5mo ago
["@nuxt/ui", "@nuxtjs/i18n", "@nuxt/fonts", "@nuxt/eslint"] @cuebit
Cue
Cueβ€’5mo ago
What version of i18n?
Reeed
ReeedOPβ€’5mo ago
8.1.1
Cue
Cueβ€’5mo ago
Could you possibly upgrade to latest (8.5.5)? I suspect the older versions are augmenting "@vue/runtime-core" instead of "vue" which leads to these issues.
Reeed
ReeedOPβ€’5mo ago
i just upgraded i18n, still not working

Did you find this page helpful?