Skip to content

Conversation

@DeMoorJasper
Copy link
Member

What kind of change does this PR introduce?

Fixes an infinite recursion between getDependencyVersion and resolvePath in fetch-npm-module

Sandbox to see this in action: https://codesandbox.io/s/yq0z0j (beware this will likely crash your browser-tab)

Copy link
Member

@CompuIves CompuIves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find. LGTM!

One case I had in mind, sometimes a dependency calls itself. E.g.

// node_modules/a/b.js

require('a/a'); // <- should resolve to node_modules/a/a.js

I've seen this case before once, do you think that still works?

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a45529d:

Sandbox Source
Notifications Test Configuration
FileList PR

@lbogdan
Copy link
Contributor

lbogdan commented Feb 23, 2022

Build for latest commit a45529d is at https://pr6487.build.csb.dev/s/new.

@DeMoorJasper
Copy link
Member Author

Good find. LGTM!

One case I had in mind, sometimes a dependency calls itself. E.g.

// node_modules/a/b.js



require('a/a'); // <- should resolve to node_modules/a/a.js

I've seen this case before once, do you think that still works?

That should still work afaik, there's also an integration test for that case so tests should catch that

@DeMoorJasper DeMoorJasper merged commit c93f76e into master Feb 23, 2022
@DeMoorJasper DeMoorJasper deleted the fix/resolver-recursion branch February 23, 2022 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants