-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix infinite loop in resolver when using ~/...
imports
#1881
Conversation
~
~
~
~/...
imports
src/Resolver.js
Outdated
@@ -132,6 +132,11 @@ class Resolver { | |||
path.basename(path.dirname(dir)) !== 'node_modules' | |||
) { | |||
dir = path.dirname(dir); | |||
|
|||
if (dir === '/') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work on Windows? What about if (dir === path.dirname(dir))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a better idea. I'll update it.
Sidenote the resolver is already broken on windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, do you know if we're tracking this somewhere?
If
~
is being used outside of rootDir and node_modules, the resolver will freeze on an infinite loop.This PR changes it to fallback to rootDir, as that's probably the intended behaviour.
SideNote: FSWatcher Update just forces parcel to use 1.0.5, which fixes an issue with profiler