Skip to content

.vue files with @ alias imports do not update when file is moved - only relative paths work #5911

@thegroosalugg

Description

@thegroosalugg

Vue - Official extension or vue-tsc version

3.2.1

VSCode version

1.107.1

Vue version

^3.5.25

TypeScript version

~5.9.0

System Info

System:
    OS: Linux 6.6 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (12) x64 13th Gen Intel(R) Core(TM) i7-1355U
    Memory: 5.30 GB / 7.60 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 24.12.0 - /home/thegroosalugg/.nvm/versions/node/v24.12.0/bin/node
    npm: 11.6.2 - /home/thegroosalugg/.nvm/versions/node/v24.12.0/bin/npm
    Deno: 2.2.6 - /home/thegroosalugg/.deno/bin/deno

package.json dependencies

"dependencies": {
    "pinia": "^3.0.4",
    "vue": "^3.5.25",
    "vue-router": "^4.6.3"
  },
  "devDependencies": {
    "@tsconfig/node24": "^24.0.3",
    "@types/node": "^24.10.1",
    "@vitejs/plugin-vue": "^6.0.2",
    "@vue/eslint-config-prettier": "^10.2.0",
    "@vue/eslint-config-typescript": "^14.6.0",
    "@vue/tsconfig": "^0.8.1",
    "eslint": "^9.39.1",
    "eslint-plugin-vue": "~10.5.1",
    "jiti": "^2.6.1",
    "npm-run-all2": "^8.0.4",
    "prettier": "3.6.2",
    "typescript": "~5.9.0",
    "vite": "^7.2.4",
    "vite-plugin-vue-devtools": "^8.0.5",
    "vue-tsc": "^3.1.5"
  }
}

Steps to reproduce

Create a Vue 3 project with TypeScript and @ alias configured in tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}

Create two .vue files:

src/components/TestComponent.vue
src/App.vue that imports TestComponent using import TestComponent from '@/components/TestComponent.vue'

Move TestComponent.vue to a different folder (e.g., src/other/TestComponent.vue)
Observe that the import in App.vue is NOT updated and remains @/components/TestComponent.vue

What is expected?

The import path should automatically update to @/other/TestComponent.vue when the file is moved, just like it does for .ts files and just like relative imports (./ ../) work correctly.

What is actually happening?

.vue files with @ alias imports do NOT update when files are moved
.ts files with @ alias imports DO update correctly
.vue files with relative imports (./ ../) DO update correctly
Only .vue files with absolute @ alias imports fail to update

The "Update imports" dialog does not appear at all when moving .vue files that use @ alias imports.

Link to minimal reproduction

No response

Any additional comments?

The JS/TS update imports settings are already enabled:

javascript.updateImportsOnFileMove.enabled: always
typescript.updateImportsOnFileMove.enabled: always

vue.updateImportsOnFileMove.enabled is no longer recognised by VScode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good reproduction ✨This issue provides a good reproduction, we will be able to investigate it firstupstream: volar

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions