-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Deep references no longer working #76
Comments
I'm unsure about the intent of this code. This is where the bug occurs: dir.replace(/[\\\/]*[^\\\/]+[\\\/]*/, ''), cb This will cause recursion like:
I would assume what you really want is:
But in that case why a regex and not path.dirname? That leads me to believe my assumption about what this code is trying to do might be wrong. I updated this regex with one that does what I think it should do but that breaks a couple of other tests. But I can't imagine the behavior that is currently happening is intentional. Could you give some insight as to why you implemented it this way @substack? |
This test shows that deep references do not work currently.
I've added a breaking test. Using a different regex or path.dirname will fix this issue but cause other tests to fail which seem to depend on this bug. I'm going to try and investigate what they are doing. |
Ok, after looking at the failing tests they were checking if a pkg was found (expecting it not to be) but I don't think this is a necessary part of the tests. The precedence test is verifying that precedence is given to folder/index.js and that is working. Submitting a PR. |
This fixes async resolution when looking for a package.json file. Previously a regex was being used that was not allowing the recursive behavior the code is attempting. Replacing with path.dirname fixes the issue. Fixes browserify#76
This upgrades the resolve dependency which fixed browserify/resolve#76
#62 added the ability to reference modules deeply with "browser". It seems that functionality is no longer working. For example
deep/ref
will work butvery/deep/ref
will not.I think the reason is this regular expression: https://github.com/substack/node-resolve/blob/master/lib/async.js#L109
I assume this is intended to chop off the back but instead is chopping off the front.
/Users/matthew/foo
becomesmatthew/foo
. I'll submit a new test and fix the regex.The text was updated successfully, but these errors were encountered: