Skip to content

You may need an appropriate loader for dynamic imports after upgrade to Angular 8 #14566

Closed
@BrsJsk

Description

@BrsJsk

🐞 bug report

Description

I've updated my Angular 7 app to Angular 8. It used the old Angular way dynamic imports.
i've ran ng update @angular/cli @angular/core, everything was updated properly and it was using the new standard for dynamic imports, but app cannot now be opened. It breaks during the compile process. This might be webpack issue?

🔬 Minimal Reproduction

Updated to Angular 8 and this error is throwing.

🔥 Exception or Error


ERROR in ./src/app/app-routing.module.ts 8:28
Module parse failed: Unexpected token (8:28)
You may need an appropriate loader to handle this file type.
|     {
|         path: 'auth',
>         loadChildren: () => import('./auth/auth.module').then(m => m.AuthModule)
|     },
|     {

🌍 Your Environment

Angular Version:


Angular CLI: 8.0.0
Node: 10.13.0
OS: darwin x64
Angular: 8.0.0

@angular-devkit/architect          0.800.0
@angular-devkit/build-angular      0.800.0
@angular-devkit/build-optimizer    0.800.0
@angular-devkit/build-webpack      0.800.0
@angular-devkit/core               8.0.0
@angular-devkit/schematics         8.0.0
@angular/cdk                       7.3.1
@angular/material                  7.3.1
@angular/material-moment-adapter   7.3.1
@ngtools/webpack                   8.0.0
@schematics/angular                8.0.0
@schematics/update                 0.800.0
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.30.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions