diff --git a/lib/module.js b/lib/module.js index 0b87cf7480e4d9..96f36c815a5c7e 100644 --- a/lib/module.js +++ b/lib/module.js @@ -435,7 +435,7 @@ Module._load = function(request, parent, isMain) { if (experimentalModules) { if (filename === null || /\.mjs$/.test(filename)) { try { - ESMLoader.import(request).catch((e) => { + ESMLoader.import(getURLFromFilePath(filename).href).catch((e) => { console.error(e); process.exit(1); });