Uh oh!
There was an error while loading. Please reload this page.
module: avoid throwing when findPackageJSON is called on nonexistent - #55822
module: avoid throwing when findPackageJSON is called on nonexistent#55822JakobJingleheimer wants to merge 1 commit into
findPackageJSON is called on nonexistent#55822Conversation
nodejs-github-bot
commented
Nov 11, 2024
Review requested:
|
de8448a to
b923210Compareaduh95
commented
Nov 11, 2024
The commit message guidelines stipulates that the word after the subsystem needs to be an imperative verb, could you amend it please? |
b923210 to
a565f22ComparefindPackageJSON avoid ERR_INVALID_ARG_TYPE when unfoundERR_INVALID_ARG_TYPE when findPackageJSON is stumpedJakobJingleheimer
commented
Nov 11, 2024
@aduh95 the character limit makes this quite a challenge 😅 |
aduh95
commented
Nov 11, 2024
Here's a suggestion: |
a565f22 to
c02aebcCompareERR_INVALID_ARG_TYPE when findPackageJSON is stumpedfindPackageJSON is called on nonexistentCodecov 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
|
JakobJingleheimer
commented
Nov 12, 2024
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 |
aduh95
commented
Nov 12, 2024
Let’s not, without a test we cannot detect regressions. |
JakobJingleheimer
commented
Dec 14, 2024
@AugustinMauroy found the reproduction 🎉 https://github.com/AugustinMauroy/issue-node-findpackagejson |
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.