From fccab24a01f1748bce223de51801812431362ac5 Mon Sep 17 00:00:00 2001 From: guybedford Date: Wed, 13 Sep 2017 13:33:07 +0200 Subject: [PATCH] module: ensure exact file url passed to top-level import for main Fixes: https://github.com/nodejs/node/issues/15374 --- lib/module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); });