TypeScript: forceConsistentCasingInFileNames error message doesn't contain enough information
TypeScript Version:
1.9.0-dev.20160301
Code
a.ts
import B from './b';
console.log(B);
B.ts (note the casing here)
export default function B() {
}
Expected behavior: a.ts is never referred in the the error so it is impossible to know which file and line number is actually trying to import it.
Actual behavior:
tsc a.ts B.ts --forceConsistentCasingInFileNames
error TS1149: File name 'B.ts' differs from already included file name 'C:/dev/sample/a/b.ts' only in casing
Doesn’t work with --pretty flag enabled too.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 5
- Comments: 19 (6 by maintainers)
I’ve been able to accurately reproduce this bug (in a single project) by using
forceConsistentCasingInFileNamesset totrueand using theextendskeyword. By removing the extends, the bug goes away. However, I’m not always seeing this in every project that utilizes this schema. I have randomly hit this bug.@Delagen – not sure, but maybe this is the issue you were facing? #16875
It happens reliably when using the
extendsproperty intsconfig.json.