Skip to content

vue(404) error on opening .vue file after fresh clone – global types path or vue dependency warning #5554

@AshtonSW

Description

@AshtonSW

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

  1. Clone a Vue project using only JavaScript (no TS, no Volar)
  2. Run npm install or yarn install
  3. Open the project in VSCode
  4. Immediately open any .vue file before restarting VSCode
  5. 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! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions