After much research, I'm still struggling with a minor Vetur issue in my Vue3 + ts setup. Despite trying various modifications to the tsconfig file recommended by others, none of them have resolved the warnings I'm encountering.
I attempted to include the dom
, es2016
, and dom.iterable
lib packages, but they did not make a difference. It seems like there might be a conflict with another setting in my tsconfig, but I haven't been able to identify it yet.
I also tried the workaround of using cmd+shift+p
followed by Developer: Reload window
, and even restarted VSCode, but unfortunately, those solutions didn't work either.
The errors I'm facing are quite generic, such as:
"Cannot find name window
", "Cannot find name document
", "Cannot find name HTMLElement
", and "
Cannot find name HTMLCanvasElement
".
I've included my entire tsconfig.json
below for reference:
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env",
"jest"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"es2016",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}
Notably, I've tagged this question with vuejs3 as well since although it's related to Vetur in VS Code, it ties back to Vue tooling.