I have upgraded to Angular 8 and found the in lazy loading modules routing. While upgrading CLI itself changed all my lazy loading routes according to new syntax.
ERROR in ./src/app/app.routing.ts 31:36 Module parse failed: Unexpected token (31:36) You may need an appropriate loader to handle this file type. | title: "abc" | },
loadChildren: () => import('./modules/abc/abc.module').then(m => m.AbcModule)
| }, | {
children: [ {path: '', pathMatch: 'full', component: InfoComponent, canActivate: [AuthGuard], }, { path: 'abc', loadChildren: () => import('abc/abc.module').then((m) => m.AbcModule), }]
You could try to remove the package-lock.json
and run npm install
again. If this does not work, you could try to run yarn
. This will fix the acorn package from webpack. You can also try this manually by updating to acorn@6.1.1
using npm.
Install acorn node module to existing project.
npm install acorn@6.1.0--save
Then try below instruction,This might solve the problem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.