-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
require(".\\") doesn't resolve index.js on Windows #18299
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
Comments
It looks like part of the issue is in Line 365 in a3555d0
but is snipped:
|
@jdalton I think we could probably have windows normalize |
This is required to get around a node.js bug when paths start with './' nodejs/node#18299
This is required to get around a node.js bug in Windows when paths start with './' nodejs/node#18299
@jdalton ^^^^ |
@nodejs/modules-active-members @jdalton Should this be closed? Or is this an issue that should be addressed? |
There's been no further action on this. Closing, but given that it's not fully resolved, I'm putting this on the Futures project board so that it does not get lost. |
@jasnell why would an inactive issue that's still a problem be closed? |
An unresolved issue that no one ever looks at isn't useful either. These can always be reopened if someone intends to pick it up. Also, after I'm done taking a triage pass at all these stale old issues I'll be compiling a list of outstanding issues for each subsystem |
How can anyone ever decide to pick it up if it's closed? |
I've reopened but as I said, "I'm putting this on the Futures project board so that it does not get lost." and "after I'm done taking a triage pass at all these stale old issues I'll be compiling a list of outstanding issues for each subsystem" ... |
Can confirm this issue has been fixed with all these paths:
Tested versions: |
As this appears to be fixed on all supported versions, I'm going to close it. Of course, if that's wrong and it's still an issue somewhere, please comment or re-open. |
Oh, wait, no, there's still one problem left, right? |
Nope, it's just quoted from the original post. All cases do not throw errors |
Uh oh!
There was an error while loading. Please reload this page.
While looking at #15015 (comment) I noticed that the trailing slash check in
_findPath
was only keying off of a forward slash and not the backslash that Windows allows.You can repro this by simply doing the following in a directory with an
index.js
Other places in Node account for the backslash in Windows paths so this looks like an oversight.
Update:
It looks like if it's a two dot relative path to an index.js then it does work.
Also this
Notes:
It looks like
path.resolve
handles these cases fine so it can be excluded from the problem.The text was updated successfully, but these errors were encountered: