-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Import are case insensitive in window 10 #36968
Comments
this is because the filesystem on your windows machine is case insensitive. not much we can do about that. |
There are quite a lot of layers between Node.js ESM loader and the actual file on your hardware. The gist of it is that it relies on the Windows API, which is case insensitive by default. If you check the Windows API documentation, you can see there is a I suggest to open an issue on libuv/libuv (the library Node.js relies on for FS related operations) asking for this flag to be enabled. They'll know if that's something possible without breaking the ecosystem. |
May I suggest, do not use libuv fs for imports and instead implement something more strict. I feel like this will create a lot of "but in works on my machine !" - type of situation especially in team where some developers have Linux and some have windows machines. And it is not only for backend since a lot of Front End tools use NodeJs as well nowadays. |
Well, you are very welcome to open a PR, but I doubt it's a reasonable way of solving your issue. Also, there are filesystems out there which are case insensitive (E.G.: HFS+), and there is no way around that on the software level. |
Sorry for the necro and somewhat off-topic comment. But for Typescript users who come here via Google, there's a config option to detect similar imports that have mismatched casing:
Not perfect, but still helpful. There's a long-running issue over at the Typescript repo that seems to be making some progress though: microsoft/TypeScript#21736 |
It seems this is working as intended, so I'm closing this issue, but if anyone disagrees, please re-open |
What steps will reproduce the bug?
a.js
b.js
package.json
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
B.js not found (Uppercase)
What do you see instead?
no errors
Additional information
It creates error on linux
The text was updated successfully, but these errors were encountered: