Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File name ... differs from already included file name ... only in casing

I’m getting the following error in VSCode in my Angular 6 application:

ERROR in src/app/providers/dynamic-data/dynamic-data.service.ts(5,26): error TS1149: File name '/Users/gibranshah/repos/eva/EVA/src/app/model/endpoint.ts' differs from already included file name '/Users/gibranshah/repos/eva/EVA/src/app/model/Endpoint.ts' only in casing.

It’s telling me that this line in dynamic-data.service.ts:

import { Endpoint } from '../../model/endpoint';

…refers to a file whose name is Endpoint.ts. But there is no such file. Instead, I have endpoint.ts. endpoint.ts contains a class like this:

export class Endpoint {
…
}

endpoint.ts might have been named ‘Endpoint.ts’ at one point, put it’s not anymore.

I tried to do a find for ‘Endpoint.ts’ but came up short:

M0168169000:gibranshah gibranshah$ find * -name "Endpoint.ts"
M0168169000:gibranshah gibranshah$ 

Does VSCode cache files? Is it possible it’s using a cached version of Endpoint.ts? How do I fix this problem?

like image 817
Gibran Shah Avatar asked Jan 09 '19 16:01

Gibran Shah


2 Answers

i had this issue and it was a directory name capitalization problem.

i was importing my component like this :

../proxies/test.component

../Proxies/test.component
like image 200
MajiD Avatar answered Oct 06 '22 01:10

MajiD


I had a similar issue and solved it by closing the folder, then on the Recent workspaces list click More at the bottom, and from the list click the 'x' (remove) button to remove the workspace. Then, after loading the project's folder, it build normally. So probably there is some cache and that is probably one way to clear it.

like image 40
pevgeniev Avatar answered Oct 06 '22 00:10

pevgeniev