-
Notifications
You must be signed in to change notification settings - Fork 519
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
Further node resolve filename fix #784
Further node resolve filename fix #784
Conversation
@alexeagle any idea why these changes (as well as the ones from #778) would fail on windows only? As far as I can see the code is platform independent and I also do not have a windows laptop to debug. |
This Pull Request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
This PR was automatically closed because it went two weeks without a reply since it was labeled "Can Close?" |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
Another fix of very corner case module importing of a usage that I found in one of our dependencies: https://github.com/nuxt/nuxt.js/blob/91c3642e64166a939683b856e5b34ef42d12bb0e/packages/core/src/resolver.js#L26
I did also submit a possible fix to the project itself: nuxt/nuxt#5796 but not sure if it will get accepted at this stage.
What is the current behavior?
does not work because of the checks done in the custom
_resolveFilename
methodWhat is the new behavior?
Node.js seems to allow a call of:
which seems to behave very similar to
require.resolve(npm_module, {paths: [".."]})
but it does work different internally as the first invocation sets the paths of the parent rather than setting options. So now we check ifparent.paths
has been set and special case that import so it can work.Does this PR introduce a breaking change?
Other information
Not a 100% sure if we should really support this but I guess it does work with vanilla nodejs, so it may be worth it.