We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a32783 commit 77bb2beCopy full SHA for 77bb2be
dist-raw/runmain-hack.js
@@ -1,7 +1,9 @@
1
+const {pathToFileURL} = require('url');
2
+
3
// Hack to avoid Module.runMain on node 18.6.0
4
// Keeping it simple for now, isolated in this file.
5
// Could theoretically probe `getFormat` impl to determine if `import()` or `Module._load()` is best
6
// Note that I attempted a try-catch around `Module._load`, but it poisons some sort of cache such that subsequent `import()` is impossible.
7
exports.run = function(entryPointPath) {
- import(entryPointPath);
8
+ import(pathToFileURL(entryPointPath));
9
}
0 commit comments