You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error while using typescript 3.8 export aliases聽#17231
ERROR in ./src/app/stuff/index.ts 1:9
Module parse failed: Unexpected token (1:9)
File was processed with these loaders:
* ./node_modules/@ngtools/webpack/src/index.js
You may need an additional loader to handle the result of these loaders.
> export * as fromFoo from './foo';
In your project, the "module" compiler flag in tsconfig.json is configured as "esnext". This means that the export is preserved as is, however some part of the toolchain is unable to process that syntax. If you change "module" to "es2015" instead it will work.
Setting the "module" flag to "es2015" only works, if lazy loading is not used.
Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
12 loadChildren: () => import('./features/foo/foo.module').then((m) => m.FooModule)
Reacted by Guillaume Lecomte, Toni Villena, Marcus Rettig and KingDarBoja
Habing same issue as author, setting the module flag as "ES2015" will fix it if not using lazy loading, which does break with this change :/ Subscribing to this issue to know when it is fixed.
Activity
JoostK commentedon Mar 15, 2020
In your project, the
"module"compiler flag intsconfig.jsonis configured as"esnext". This means that the export is preserved as is, however some part of the toolchain is unable to process that syntax. If you change"module"to"es2015"instead it will work.JoostK commentedon Mar 15, 2020
Looks like it's Webpack itself that has to support this syntax so that it can work its magic: webpack/webpack#10460
TomTomB commentedon Mar 15, 2020
Setting the
"module"flag to"es2015"only works, if lazy loading is not used.troywweber7 commentedon May 15, 2020
Is there a workaround for this?
KingDarBoja commentedon Sep 6, 2020
Habing same issue as author, setting the module flag as
"ES2015"will fix it if not using lazy loading, which does break with this change :/ Subscribing to this issue to know when it is fixed.brianpooe commentedon Oct 15, 2020
Any news yet on this?
alan-agius4 commentedon Oct 15, 2020
This should be fixed in Webpack 5 (webpack/webpack#11117), which is currently in opt-in preview in Angular CLI 11.
See #18820 for more information on how to opt-in Webpack 5.
angular-automatic-lock-bot commentedon Nov 15, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.