Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly emitted error TS1149: File name differs from already included file name only in casing #38181

Closed
alespergl opened this issue Apr 25, 2020 · 6 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@alespergl
Copy link

TypeScript Version: 3.8.3

Search Terms:
forceConsistentCasingInFileNames, TS1149

Code
index.ts

/// <reference types="./foo" />
/// <reference types="./Bar" />

foo.d.ts

// empty

Bar.d.ts

// empty

tsconfig.json

{
    "compilerOptions": {
        "forceConsistentCasingInFileNames": true
    }
}

Expected behavior:
Clean compile.

Actual behavior:

index.ts:2:23 - error TS1149: File name '/.../bar.d.ts' differs from already included file name '/.../Bar.d.ts' only in casing.

2 /// <reference types="./Bar" />
                        ~~~~~


Found 1 error.

Playground Link:

Related Issues:
#25460

@sheetalkamat
Copy link
Member

sheetalkamat commented Apr 27, 2020

This is because types are always lower case #10340
@RyanCavanaugh and @DanielRosenwasser to weigh in on this but this was intended behavior

@DanielRosenwasser
Copy link
Member

Uh, I didn't even realize that types could get relative paths, but since they do I think maybe they should not automatically lowercase. I'd wait for Ryan on input here.

@sheetalkamat
Copy link
Member

But its not just the path that's the issue. its the type itself being referred to as Bar and will become bar

@RyanCavanaugh RyanCavanaugh added the Working as Intended The behavior described is the intended behavior; this is not a bug label Jun 2, 2020
@typescript-bot
Copy link
Collaborator

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@kodekage
Copy link

kodekage commented Jul 8, 2020

How can one resolve the compilation error?

@mrfambo
Copy link

mrfambo commented Aug 21, 2020

Solution: tsconfig.json
"forceConsistentCasingInFileNames": false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

7 participants