Skip to content

Commit 77bb2be

Browse files
committed
fix
1 parent 6a32783 commit 77bb2be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dist-raw/runmain-hack.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
const {pathToFileURL} = require('url');
2+
13
// Hack to avoid Module.runMain on node 18.6.0
24
// Keeping it simple for now, isolated in this file.
35
// Could theoretically probe `getFormat` impl to determine if `import()` or `Module._load()` is best
46
// Note that I attempted a try-catch around `Module._load`, but it poisons some sort of cache such that subsequent `import()` is impossible.
57
exports.run = function(entryPointPath) {
6-
import(entryPointPath);
8+
import(pathToFileURL(entryPointPath));
79
}

0 commit comments

Comments
 (0)