My current project uses Vite (Vue) along with Typescript.
However, when I execute the command yarn build (vue-tsc --noEmit && vite build),
I encounter a series of errors similar to this one:
Error TS2304: Cannot find name 'title'. https://i.sstatic.net/661vX.png
Even though I am certain that I have defined those variables.
https://i.sstatic.net/ZkKJh.png
I suspect this issue is related to the setup in <script setup lang="ts">.
Here is my current tsconfig configuration:
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": [
"esnext",
"dom"
],
"baseUrl": ".",
"paths": {
"@/": [
"src/*"
]
},
"isolatedModules": true,
"skipLibCheck": true
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue"
],
"references": [
{
"path": "./tsconfig.node.json"
}
]
}