-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
module: avoid throwing when findPackageJSON
is called on nonexistent
#55822
module: avoid throwing when findPackageJSON
is called on nonexistent
#55822
Conversation
Review requested:
|
de8448a
to
b923210
Compare
The commit message guidelines stipulates that the word after the subsystem needs to be an imperative verb, could you amend it please? |
b923210
to
a565f22
Compare
findPackageJSON
avoid ERR_INVALID_ARG_TYPE
when unfoundERR_INVALID_ARG_TYPE
when findPackageJSON
is stumped
@aduh95 the character limit makes this quite a challenge 😅 |
Here's a suggestion: |
a565f22
to
c02aebc
Compare
ERR_INVALID_ARG_TYPE
when findPackageJSON
is stumpedfindPackageJSON
is called on nonexistent
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.
Can you add a test?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55822 +/- ##
==========================================
+ Coverage 88.39% 88.41% +0.01%
==========================================
Files 654 654
Lines 187560 187814 +254
Branches 36087 36132 +45
==========================================
+ Hits 165800 166048 +248
- Misses 14996 15007 +11
+ Partials 6764 6759 -5
|
Yes, I intend to do, but I have to re-figure out how to re-produce it. I'm 100% certain this fixes the issue and does not cause adverse results, so can we land this without the test-case and add it subsequently so users can get the fix rather than wait? |
@aduh95 now that I re-read the updated title, I think it's actually not accurate: the issue does not occur when |
Let’s not, without a test we cannot detect regressions. |
fix LGTM but i agree this should probably have a test case before landing |
The edge-case occurs when ESMLoader can't resolve the target.
The documented behaviour is already for it to return
undefined
, so this fixes a small bug.