Type errors all over my Nuxt 3 project
Hi, for some reason, I'm getting nonsensical type errors all over my Nuxt project.
For example, `const` keyword is underlined with the error `Expression expected`
`onMounted` says that `Object is possibly 'undefined'`
and so on...
I've tried removing `.nuxt` and `node_modules` several times and nothing helped.
This is what my package.json looks like:
{
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@nuxt/image-edge": "^1.0.0-27990059.c3f31ce",
"@nuxtjs/google-fonts": "^3.0.0",
"@nuxtjs/i18n": "^8.0.0-beta.10",
"autoprefixer": "^10.4.14",
"nuxt": "^3.3.1",
"sass": "^1.59.3"
},
"dependencies": {
"@nuxtjs/device": "^3.1.0",
"@pinia/nuxt": "^0.4.7",
"@types/node": "^18.15.11",
"@vueuse/nuxt": "^9.13.0",
"typescript": "^5.0.3",
"vue-tsc": "^1.2.0"
}
}
Have you seen an issue like this before? How could I fix it?
请先登录再写评论。
this issue is tracked at https://youtrack.jetbrains.com/issue/WEB-60063/IDE-shows-incorrect-errors-for-import-statements-with-Typescript-5.0-in-Vue-SFC, please follow it for updates. As a workaround, please try choosing Bundled as Typescriptvalue in Settings | Languages & Frameworks | TypeScript
Oh, I see. Thank you!