'File name differs from already included file name only in casing' on relative path with same casing 'File name differs from already included file name only in casing' on relative path with same casing windows windows

'File name differs from already included file name only in casing' on relative path with same casing


In my case, the error was in the import statement. The import statement had a capital letter instead of small letter, which worked during develop in Windows, but not when compiling for production.

wrong:

import {SomeClass} from '/some/path/SomeClass.ts';

correct:

import {SomeClass} from '/some/path/someClass.ts';


For me, the issue occurred when a file was quickly renamed from someFile.ts to SomeFile.ts. Restarting my IDE (Visual Studio Code) made the warning go away.


You need to disable the "forceConsistentCasingInFileNames" in the tsconfig.json file.

So you should have something like that:

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