I just updated an Angular 7 app to the latest version (8.0.2) following the steps of this guide:
https://update.angular.io/#7.0:8.0
As the last step indicates, I've replaced the way I load lazy modules using the new syntax:
FROM:
loadChildren: "./modules/fwc-policy/fwc-policy.module#FwcPolicyModule"
TO:
loadChildren: () => import('./modules/fwc-policy/fwc-policy.module').then(m => m.FwcPolicyModule)
But now, when I try to compile the application I get this error:
ERROR in src/app/modules/fwc-dashboard/fwc-dashboard.routes.ts(42,31): error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
After googling a bit, I added the option "module": "esNext" to the tsconfig.json file, but the error remains. Do I need to change anything else to make it work?
Thanks in advance,
npm startfrom the command line and I got the same error... I changed thetargetoption fromes6toesNextto see what happens and I got another error:WARNING: Zone.js does not support native async/await in ES2017..targetinside tsconfig, try"target": "es2015"