You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
forceConsistentCasingInFileNames does not always work with paths compiler option #17617
// Base tsconfig at /Users/a_user/a_repo/core.json{"compilerOptions": {"forceConsistentCasingInFileNames": true,"baseUrl": "","paths": {"*": ["*","src/*"]}}}// tsconfig at /Users/a_user/a_repo/tsconfig.json{"extends": "./core"}// Source file in /Users/a_user/a_repo/src/foo.tsconstv=1;exportdefaultv;// Source file in /Users/a_user/a_repo/src/bar.tsimportvfrom"foo";
Expected behavior:
No compiler errors/warnings
Actual behavior:
error TS1149: File name '/Users/a_user/a_repo/src/foo.ts' differs from already included file name '/users/a_user/a_repo/src/foo.ts' only in casing.
This is running on OS X 10.9.5 (default case-insensitive HFS file system).
I am only able to reproduce the issue when using configuration inheritance. Using an absolute path with the expected casing for baseUrl resolves the issue.
Adam Rackis (@arackaf) it is --baseUrl that causes the issue. When it is inherited, it seems to get resolved in such a way that the resulting paths begin with its lowercase variant. the simplest work around currently is to specify the base URL a second time in the inheriting configuration.
Sorry, it's not in the issue title but the op states that the issue can only be reproduced when using configuration inheritance. This has been my experience as well.
Oh interesting. Well I may have stumbled onto a different repro of the same bug. I only have one tsconfig.json in my project, but this still fails for me. I ran a search on my file system, and the only other tsconfig file anywhere is in node_modules, which I've explicitly excluded.
Mohamed Hegazy (@mhegazy) When is the fix in 18058 going to show up in a new version? If that doesn't fix my issue, then sure, I'll open a new ticket, hopefully with a minimal repro
Cool, but when do you expect the next regular release on npm? Want to try that on my work repo. We definitely can't be running typescript@next in prod :)
This is still happening to me in 2.7.1 on mac OS. I'm using inherited tsconfigs, it doesn't matter where baseUrl is specified, tried all permutations.
All the errors reported are for ambient d.ts typings and module declarations, under node_modules/@types and our own internal types folder, which seems relevant. The /Users root folder lowercased.
Wesley Wigham (@weswigham) yes! It fixes the issue. It is consistently observed in previous versions but upon switching to 2.7.2 all works correctly.
Thank you very much.
Activity
aluanhaddad commentedon Aug 5, 2017
Thank you for filing this. I see the exact same behavior. Interestingly, if I set
baseUrlin the extending tsconfig, it also resolves the error.afshinm commentedon Sep 3, 2017
I have the same problem on mac OS, node 7.6.0.
arackaf commentedon Sep 6, 2017
Reproduced on Windows 10 as well. Interestingly, we don't even have paths set. Full tsconfig:
aluanhaddad commentedon Sep 6, 2017
Adam Rackis (@arackaf) it is
--baseUrlthat causes the issue. When it is inherited, it seems to get resolved in such a way that the resulting paths begin with its lowercase variant. the simplest work around currently is to specify the base URL a second time in the inheriting configuration.arackaf commentedon Sep 7, 2017
What do you mean "inherited" ? I only have one tsconfig file - what's being inherited where?
aluanhaddad commentedon Sep 7, 2017
Sorry, it's not in the issue title but the op states that the issue can only be reproduced when using configuration inheritance. This has been my experience as well.
I'm also running Windows 10, professional x64
arackaf commentedon Sep 7, 2017
Oh interesting. Well I may have stumbled onto a different repro of the same bug. I only have one tsconfig.json in my project, but this still fails for me. I ran a search on my file system, and the only other tsconfig file anywhere is in node_modules, which I've explicitly excluded.
mhegazy commentedon Sep 7, 2017
OP should be addressed by #18058.
Adam Rackis (@arackaf) can you share more context about your issue, preferably in a new ticket.
arackaf commentedon Sep 7, 2017
Mohamed Hegazy (@mhegazy) When is the fix in 18058 going to show up in a new version? If that doesn't fix my issue, then sure, I'll open a new ticket, hopefully with a minimal repro
mhegazy commentedon Sep 7, 2017
it should be in today's
typescript@next.arackaf commentedon Sep 7, 2017
Cool, but when do you expect the next regular release on npm? Want to try that on my work repo. We definitely can't be running typescript@next in prod :)
mhegazy commentedon Sep 7, 2017
should be in 2.6, scheduled for October
arackaf commentedon Sep 8, 2017
Oh my - seems I missed 2.5! :D
jamietre commentedon Feb 16, 2018
This is still happening to me in 2.7.1 on mac OS. I'm using inherited tsconfigs, it doesn't matter where
baseUrlis specified, tried all permutations.All the errors reported are for ambient
d.tstypings and module declarations, undernode_modules/@typesand our own internal types folder, which seems relevant. The/Usersroot folder lowercased.weswigham commentedon Feb 16, 2018
A similarish bugfix related to consistent casing shipped in 2.7.2, which as it happens released today. Does it fix your issues?
aluanhaddad commentedon Feb 16, 2018
Wesley Wigham (@weswigham) yes! It fixes the issue. It is consistently observed in previous versions but upon switching to 2.7.2 all works correctly.
Thank you very much.
jamietre commentedon Feb 16, 2018
Works for me too! Talk about instant gratification..