File tree 5 files changed +43
-10
lines changed
5 files changed +43
-10
lines changed Original file line number Diff line number Diff line change @@ -484,16 +484,16 @@ function runMainESM(mainPath) {
484
484
return esmLoader . initializeLoader ( ) . then ( ( ) => {
485
485
const main = path . isAbsolute ( mainPath ) ?
486
486
pathToFileURL ( mainPath ) . href : mainPath ;
487
- return esmLoader . ESMLoader . import ( main ) . catch ( ( e ) => {
488
- if ( hasUncaughtExceptionCaptureCallback ( ) ) {
489
- process . _fatalException ( e ) ;
490
- return ;
491
- }
492
- internalBinding ( 'errors' ) . triggerUncaughtException (
493
- e ,
494
- true /* fromPromise */
495
- ) ;
496
- } ) ;
487
+ return esmLoader . ESMLoader . import ( main ) ;
488
+ } ) . catch ( ( e ) => {
489
+ if ( hasUncaughtExceptionCaptureCallback ( ) ) {
490
+ process . _fatalException ( e ) ;
491
+ return ;
492
+ }
493
+ internalBinding ( 'errors' ) . triggerUncaughtException (
494
+ e ,
495
+ true /* fromPromise */
496
+ ) ;
497
497
} ) ;
498
498
}
499
499
Original file line number Diff line number Diff line change
1
+ // Flags: --experimental-modules --experimental-loader i-dont-exist
2
+ import '../common/index.mjs' ;
3
+ console . log ( 'This should not be printed' ) ;
Original file line number Diff line number Diff line change
1
+ (node:*) ExperimentalWarning: The ESM module loader is experimental.
2
+ (node:*) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
3
+ internal/modules/esm/default_resolve.js:*
4
+ let url = moduleWrapResolve(specifier, parentURL);
5
+ ^
6
+
7
+ Error: Cannot find package 'i-dont-exist' imported from *
8
+ at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:*:*)
9
+ at Loader.resolve (internal/modules/esm/loader.js:*:*)
10
+ at Loader.getModuleJob (internal/modules/esm/loader.js:*:*)
11
+ at Loader.import (internal/modules/esm/loader.js:*:*)
12
+ at internal/process/esm_loader.js:*:*
13
+ at Object.initializeLoader (internal/process/esm_loader.js:*:*)
14
+ at runMainESM (internal/bootstrap/pre_execution.js:*:*)
15
+ at Function.Module.runMain (internal/modules/cjs/loader.js:*:*)
16
+ at internal/main/run_main_module.js:*:* {
17
+ code: 'ERR_MODULE_NOT_FOUND'
18
+ }
Original file line number Diff line number Diff line change
1
+ // Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/syntax-error.mjs
2
+ import '../common/index.mjs' ;
3
+ console . log ( 'This should not be printed' ) ;
Original file line number Diff line number Diff line change
1
+ (node:*) ExperimentalWarning: The ESM module loader is experimental.
2
+ (node:*) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
3
+ file://*/test/fixtures/es-module-loaders/syntax-error.mjs:2
4
+ await async () => 0;
5
+ ^^^^^
6
+
7
+ SyntaxError: Unexpected reserved word
8
+ at Loader.moduleStrategy (internal/modules/esm/translators.js:*:*)
9
+ at async link (internal/modules/esm/module_job.js:*:*)
You can’t perform that action at this time.
0 commit comments