Description
Bug Report
🔎 Search Terms
File differs from already included file only in casing
, only in casing
, File differs
🕗 Version & Regression Information
This changed between version 4.7.4
and 4.8.2
. I tested with 4.8.1-rc
and it still works fine, so maybe something happened in 4.8.2
💻 Code
This is my repro branch
akphi/issue-repo#9
If I have to speculate, the particular thing about my setup is I use
module: NodeNext
andforceConsistentCasingInFileNames: true
and insrc
folder, I have 2 files: (1) imports something from a library package (e.g.serializr
) and (2) imports something from a package that hasserializr
as a dependency) (note that I already tested with other packages to make sure it doesn't only happen toserilizr
).
(2) imports from@finos/legend-shared
, a package that ships ESM code. Really sorry about this complexity in the setup, I have tried my best to reduce the size of the repro 🙏. But this is crucial for our setup: basically, we have a codebase that publishes@finos/legend-shared
- an utility only library and consume that in another codebase, hence when I bump into this error
To reproduce the issue, run the following:
npm install && npm run dev:ts
🙁 Actual behavior
I got the error
src/index.ts:1:27 - error TS1149: File name '/Users/my-user/Developer/js/issue-repo/node_modules/serializr/lib/serializr.d.ts' differs from already included file name '/users/my-user/developer/js/issue-repo/node_modules/serializr/lib/serializr.d.ts' only in casing.
The file is in the program because:
Imported via 'serializr' from file '/users/my-user/developer/js/issue-repo/node_modules/@finos/legend-shared/lib/application/SerializationUtils.d.ts' with packageId 'serializr/lib/[email protected]'
Imported via "./serializr" from file '/users/my-user/developer/js/issue-repo/node_modules/serializr/lib/constants.d.ts' with packageId 'serializr/lib/[email protected]'
Imported via "serializr" from file '/Users/my-user/Developer/js/issue-repo/src/index.ts' with packageId 'serializr/lib/[email protected]'
File is CommonJS module because '/users/my-user/developer/js/issue-repo/node_modules/serializr/package.json' does not have field "type"
1 import { serialize } from "serializr";
~~~~~~~~~~~
As you can see in my src/index.ts
file
import { serialize } from "serializr";
export { default as hashObject } from "object-hash";
import { cloneDeep } from "lodash-es";
This also fails for object-hash
and lodash-es
.
🙂 Expected behavior
This should compile fine.