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

15,591

Solution 1

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.

Solution 2

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

Solution 3

I have the same issue, and just discovered that for some reason, in some ts file it is called using capitalize letter, then I renamed it for lowercase and it works.

You can try also removing this model ts file and creating again with angular-CLI.

Solution 4

It's all about the path of files, make sure it is case-sensitive

Share:
15,591
Gibran Shah
Author by

Gibran Shah

Updated on June 04, 2022

Comments

  • Gibran Shah
    Gibran Shah about 2 years

    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?

  • John Youngtree
    John Youngtree almost 5 years
    This was my issue also - I changed how the file was being referenced in App.tsx