Skip to content

"Cannot find module" error persists after renaming .vue file #5818

@ywenhao

Description

@ywenhao

Vue - Official extension or vue-tsc version

3.1.7

VSCode version

1.106.3

Vue version

3.5.25

TypeScript version

5.9.0

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400
    Memory: 1.65 GB / 15.75 GB
  Binaries:
    Node: 24.11.1 - D:\dev\Volta\tools\image\node\24.11.1\node.EXE
    npm: 11.6.4 - D:\dev\Volta\tools\image\npm\11.6.4\bin\npm.CMD
    pnpm: 10.24.0 - D:\dev\Volta\bin\pnpm.CMD
    bun: 1.3.4 - D:\dev\Volta\bin\bun.CMD
    Deno: 2.5.6 - D:\dev\Volta\bin\deno.CMD
  Browsers:
    Chrome: 143.0.7499.41
    Edge: Chromium (140.0.3485.54)
    Firefox: 145.0.2 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.26100.1882

package.json dependencies

{
  "dependencies": {
    "vue": "^3.5.25"
  },
  "devDependencies": {
    "@prettier/plugin-oxc": "^0.0.5",
    "@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-oxlint": "~1.29.0",
    "eslint-plugin-vue": "~10.5.1",
    "jiti": "^2.6.1",
    "npm-run-all2": "^8.0.4",
    "oxlint": "~1.29.0",
    "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

  1. Create a new Hello World.vue file in the components folder
  2. Write import HelloWorld from './HelloWorld1.vue' in App.vue , which will result in an error Cannot find module './components/HelloWorld1.vue' or its corresponding type declarations.
  3. Rename the filename HelloWorld.vue to HelloWorld1.vue, but the error in App.vue still exists. After restarting the plugin, it returns to normal.

What is expected?

No error reported

What is actually happening?

Image

Link to minimal reproduction

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions