Skip to content

Commit

Permalink
fixup! module: detect ESM syntax by trying to recompile as SourceText…
Browse files Browse the repository at this point in the history
…Module

Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
  • Loading branch information
joyeecheung and JakobJingleheimer authored Apr 14, 2024
1 parent 6eec04e commit 425d8ee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/internal/modules/run_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ function executeUserEntryPoint(main = process.argv[1]) {

if (useESMLoader || retryAsESM) {
const mainPath = resolvedMain || main;
if (mainURL === undefined) {
mainURL = pathToFileURL(mainPath).href;
}
mainURL ??= pathToFileURL(mainPath).href;

runEntryPointWithESMLoader((cascadedLoader) => {
// Note that if the graph contains unsettled TLA, this may never resolve
Expand Down

0 comments on commit 425d8ee

Please sign in to comment.