module: fix ERR_REQUIRE_ESM for parentPath null#40145
Closed
guybedford wants to merge 1 commit intonodejs:masterfrom
Closed
module: fix ERR_REQUIRE_ESM for parentPath null#40145guybedford wants to merge 1 commit intonodejs:masterfrom
guybedford wants to merge 1 commit intonodejs:masterfrom
Conversation
aduh95
approved these changes
Sep 18, 2021
cjihrig
approved these changes
Sep 19, 2021
Contributor
cjihrig
left a comment
There was a problem hiding this comment.
LGTM, but is it possible to add a regression test?
Contributor
Author
|
@cjihrig I actually argue against testing cases like this - because if every code path needed to be negatively tested on its completion in JS, every single member expression, function argument would need to be tested for its null value. Also I'm tired! |
jasnell
approved these changes
Sep 20, 2021
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
15 tasks
This comment has been minimized.
This comment has been minimized.
This was referenced Sep 23, 2021
Collaborator
This was referenced Sep 26, 2021
guybedford
added a commit
that referenced
this pull request
Sep 28, 2021
PR-URL: #40145 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Contributor
Author
|
Landed in 481c160. |
This was referenced Sep 29, 2021
targos
pushed a commit
that referenced
this pull request
Oct 4, 2021
PR-URL: #40145 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just came across this one when running
require('./cjs.js')in a REPL in a project with"type": "module"where the ERR_REQUIRE_ESM was getting masked by anERR_INVALID_ARG_TYPEerror error, followed by the terrible realization it was probably my own fault!