Skip to content

Commit 5d040c2

Browse files
committed
module: fix #16476 extension lookups for top main
1 parent 6971f02 commit 5d040c2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ Module._load = function(request, parent, isMain) {
435435
ESMLoader.hook(hooks);
436436
}
437437
}
438-
await ESMLoader.import(getURLFromFilePath(request).href);
438+
await ESMLoader.import(getURLFromFilePath(request).pathname);
439439
})()
440440
.catch((e) => {
441441
console.error(e);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
require('../common');
3+
const { execFileSync } = require('child_process');
4+
5+
const node = process.argv[0];
6+
7+
execFileSync(node, ['--experimental-modules', 'test/es-module/test-esm-ok']);

0 commit comments

Comments
 (0)