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

Practical Problem: case-mismatch in package/file require statements #11889

Closed
martinheidegger opened this issue Mar 17, 2017 · 4 comments
Closed
Labels
feature request Issues that request new features to be added to Node.js. module Issues and PRs related to the module subsystem.

Comments

@martinheidegger
Copy link

I noticed recently that I can write require('myPackage') and require('mypackage') interchangeably on my OS because the OS is case-insensitive. This is problematic because when I try to use the same project, package on a OS that case-sensitive the imports don't seem to work. This seems to be an issue that could occur with any package and any file. Since its a systemic issue I think it would be good if node.js would try to check if the case of the file/folder actually matches the case entered and show an error message or deprecation warning that can be turned off via a flag.

@bnoordhuis bnoordhuis added feature request Issues that request new features to be added to Node.js. module Issues and PRs related to the module subsystem. labels Mar 17, 2017
@bnoordhuis
Copy link
Member

That's been suggested more than once in the past, see e.g. #5143. There is a more recent issue I can't find anymore that proposes exactly what you are suggesting.

The canonical filename on case-insensitive file systems can only be found by walking the directory with fs.readdir(). Doing that for every require() statement would introduce massive performance degradation that no amount of clever caching could fix.

@martinheidegger
Copy link
Author

martinheidegger commented Mar 17, 2017

Sorry for posting a duplicate then. Didn't find the other issues 😔
nodejs/node-v0.x-archive#8145 This seems to be the PR associated.

@XadillaX
Copy link
Contributor

Is this feature still in need? If yes, I will take this issue and work on it. @bnoordhuis

@bnoordhuis
Copy link
Member

Sorry, I should have closed this. I'll do that now. The feature request is understandable but there is no reasonable way to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. module Issues and PRs related to the module subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants