-
-
Notifications
You must be signed in to change notification settings - Fork 473
Description
Vue - Official extension or vue-tsc version
Not using the Volar extension. vue-tsc is not installed (JavaScript-only project).
VSCode version
1.93.1 (Universal)
Vue version
^3.5.17
TypeScript version
Not using TypeScript (JavaScript-only project).
System Info
System:
OS: macOS 14.5
CPU: (8) arm64 Apple M3
Memory: 16.00 GB
Shell: /bin/zsh
Binaries:
Node: 23.11.0
npm: 10.9.2
Browsers:
Chrome: 138.0.7204.159
Safari: 17.5
package.json dependencies
"devDependencies": {
"@eslint/js": "^9.29.0",
"@vitejs/plugin-vue": "^6.0.0",
"@vue/eslint-config-prettier": "^10.2.0",
"autoprefixer": "^10.4.21",
"eslint": "^9.29.0",
"eslint-plugin-vue": "~10.2.0",
"globals": "^16.2.0",
"postcss": "^8.5.6",
"prettier": "3.5.3",
"tailwindcss": "^3.4.17",
"vite": "^7.0.0",
"vite-plugin-vue-devtools": "^7.7.7"
}
Steps to reproduce
- Clone a Vue project using only JavaScript (no TS, no Volar)
- Run npm install or yarn install
- Open the project in VSCode
- Immediately open any .vue file before restarting VSCode
- Observe the following error:
vue(404): Write global types file failed. Please ensure that "node_modules" exists and "vue" is a direct dependency, or set "vueCompilerOptions.globalTypesPath" in "tsconfig.json" manually.
What is expected?
In a JavaScript-only Vue project with no TypeScript or language tooling installed,
.vue files should open cleanly in VSCode without triggering global type generation or TS-related errors.
What is actually happening?
Even after successfully installing dependencies,
opening a .vue file without restarting VSCode triggers a vue(404) error.
The language server tries to generate global types immediately,
even though vue is already present and TypeScript is not being used at all.
Link to minimal reproduction
N/A
Any additional comments?
This is not a critical functional bug, but rather a UX issue.
Many developers open .vue files right after cloning a project, before fully completing setup.
In those cases, this message causes unnecessary confusion — especially in projects that don’t use TypeScript or Volar.
It would be helpful if the language server:
- waited until dependencies were confirmed to be installed before checking for global types
- displayed a more beginner-friendly message like:
“Write global types file failed. Please ensure that "node_modules" exists and "vue" is a direct dependency, or set "vueCompilerOptions.globalTypesPath" in "tsconfig.json" manually.vue(404)”
- suppressed TypeScript-related errors in JS-only projects where no tsconfig.json or vue-tsc is present
Thanks for your great work! 🙏