Joseph
Joseph

Reputation: 4705

File name differs from already included file name only in casing.Vetur(1149)

There is nothing wrong with my folder structure or code.

However, after one time I change my folder name, Vetur keeps yelling this message to me.

I've tried the following things

  1. completely delete repo and commit new git
  2. reinstall Vetur
  3. reboot the computer
  4. remove node_modules

but the problem still there, how can I fix it?


2022 August Update:

It could still be reproducible, but the error description may differ; the reproduction:

  1. Make a file named Example.vue.
  2. import Example.vue into some other file
  3. Change the name Example.vue to example.vue
  4. Refactor the import statement to be example.vue as well.
  5. The error message will appear.

Upvotes: 12

Views: 13156

Answers (3)

Hu Cai
Hu Cai

Reputation: 89

You can try setting the following properties in tsconfig.json

{
  "compilerOptions": {
    "forceConsistentCasingInFileNames": false,
  }
}

Upvotes: 1

Lameck Meshack
Lameck Meshack

Reputation: 6973

I was facing the same issue, just restart or reload your vscode

Upvotes: 0

Zaphod Beeblebrox
Zaphod Beeblebrox

Reputation: 458

(Using vue.js v3) My solution was NOT to use the file extension '.vue':

Failed:

import X from './components/X.vue'

Succeeded:

import X from './components/X'

Upvotes: 11

Related Questions