-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Closed
Copy link
Description
- Version: 14.13.0
- Platform: windows 10
- Subsystem:
What steps will reproduce the bug?
@angular/core module file. https://github.com/bahuwang/issue/blob/master/core.js
demo.mjs file. https://github.com/bahuwang/issue/blob/master/demo.mjs
Just one line of code:
import { EventEmitter } from './core.js';
It is an ES modules, not CommonJS.
internal/deps/cjs-module-lexer/lexer.js:882
throw new Error('Unexpected import statement in CJS module.');
^
Error: Unexpected import statement in CJS module.
at @:7:8
?[90m at throwIfImportStatement (internal/deps/cjs-module-lexer/lexer.js:882:13)?[39m
?[90m at parseSource (internal/deps/cjs-module-lexer/lexer.js:83:13)?[39m
?[90m at parseCJS (internal/deps/cjs-module-lexer/lexer.js:38:5)?[39m
?[90m at cjsPreparseModuleExports (internal/modules/esm/translators.js:193:34)?[39m
?[90m at Loader.commonjsStrategy (internal/modules/esm/translators.js:143:35)?[39m
?[90m at new ModuleJob (internal/modules/esm/module_job.js:38:41)?[39m
?[90m at Loader.getModuleJob (internal/modules/esm/loader.js:245:11)?[39m
?[90m at async ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:53:21)?[39m
at async Promise.all (index 0)
?[90m at async link (internal/modules/esm/module_job.js:58:9)?[39m {
loc: ?[33m109?[39m
}
Metadata
Metadata
Assignees
Labels
No labels