Skip to content

Lazy loading module #9880

@FARHANE

Description

@FARHANE

Versions

 _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.7.0
Node: 8.9.4
OS: win32 x64
Angular: 5.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.2.1
@angular/cli: 1.7.0
@angular/material-moment-adapter: 5.2.1
@angular/material: 5.2.1
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.6.2
webpack: 3.11.0

Repro steps

  • Step 1
export const routes: Routes = [
    {
        path: 'pages',
        component: PageComponent,
        children: [
            {
                path: 'session',
                loadChildren: "./session/session.module#SessionModule",

            },
        ]
    },

]

export const PagesRoutingModule: ModuleWithProviders = RouterModule.forChild(routes);

TypeError: __webpack_require__.e is not a function

Observed behavior

if I modify the loadChildren to

loadChildren: ()=> SessionModule

I get this error
Cannot read property 'loadChildren' of undefined

When do save on any file the project recompile and it's work but I can not do that when I am executing ng build

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions