-
Notifications
You must be signed in to change notification settings - Fork 30k
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: fix ERR_REQUIRE_ESM for parentPath null #40145
Conversation
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.
LGTM, but is it possible to add a regression test?
@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! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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>
Landed in 481c160. |
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>
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_TYPE
error error, followed by the terrible realization it was probably my own fault!