File tree 3 files changed +11
-6
lines changed
3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ const {
4
+ ObjectCreate,
5
+ } = primordials ;
6
+
3
7
const {
4
8
ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING ,
5
9
} = require ( 'internal/errors' ) . codes ;
@@ -55,7 +59,8 @@ async function initializeLoader() {
55
59
emitExperimentalWarning ( '--experimental-loader' ) ;
56
60
return ( async ( ) => {
57
61
const hooks =
58
- await ESMLoader . import ( userLoader , pathToFileURL ( cwd ) . href , ObjectCreate ( null ) ) ;
62
+ await ESMLoader . import ( userLoader , pathToFileURL ( cwd ) . href ,
63
+ ObjectCreate ( null ) ) ;
59
64
ESMLoader = new Loader ( ) ;
60
65
ESMLoader . hook ( hooks ) ;
61
66
ESMLoader . runGlobalPreloadCode ( ) ;
Original file line number Diff line number Diff line change @@ -454,9 +454,9 @@ function REPLServer(prompt,
454
454
vm . createScript ( fallbackCode , {
455
455
filename : file ,
456
456
displayErrors : true ,
457
- importModuleDynamically : async ( specifier , _ , import_assertions ) => {
457
+ importModuleDynamically : async ( specifier , _ , import_assert ) => {
458
458
return asyncESM . ESMLoader . import ( specifier , parentURL ,
459
- import_assertions ) ;
459
+ import_assert ) ;
460
460
}
461
461
} ) ;
462
462
} catch ( fallbackError ) {
@@ -497,9 +497,9 @@ function REPLServer(prompt,
497
497
script = vm . createScript ( code , {
498
498
filename : file ,
499
499
displayErrors : true ,
500
- importModuleDynamically : async ( specifier , _ , import_asssertions ) => {
500
+ importModuleDynamically : async ( specifier , _ , import_assert ) => {
501
501
return asyncESM . ESMLoader . import ( specifier , parentURL ,
502
- import_asssertions ) ;
502
+ import_assert ) ;
503
503
}
504
504
} ) ;
505
505
} catch ( e ) {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ TypeError [ERR_FAILED_IMPORT_ASSERTION]: Failed to load module "data:text/javasc
6
6
at new NodeError (node:internal/errors:*:*)
7
7
at Loader.getModuleJob (node:internal/modules/esm/loader:*:*)
8
8
at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:*:*)
9
- at async Promise.all (index 0 )
9
+ at async Promise.all (index 1 )
10
10
at async link (node:internal/modules/esm/module_job:*:*) {
11
11
code: 'ERR_FAILED_IMPORT_ASSERTION'
12
12
}
You can’t perform that action at this time.
0 commit comments