Skip to content

Commit c005713

Browse files
guybedfordjasnell
authored andcommitted
module: check file url passed to top-level import
Fixes: #15374 PR-URL: #15389 Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 939c8ed commit c005713

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ Module._load = function(request, parent, isMain) {
459459
if (experimentalModules) {
460460
if (filename === null || /\.mjs$/.test(filename)) {
461461
try {
462-
ESMLoader.import(request).catch((e) => {
462+
ESMLoader.import(getURLFromFilePath(filename).href).catch((e) => {
463463
console.error(e);
464464
process.exit(1);
465465
});

0 commit comments

Comments
 (0)