Angular CLI ERROR in Cannot read property 'loadChildren' of null

前端 未结 11 2298
青春惊慌失措
青春惊慌失措 2021-01-01 12:24

I\'m converting a project to use angular cli and everything is working (once it\'s build) but i\'ve got a weird behaviour during build.

with ng serve I

11条回答
  •  星月不相逢
    2021-01-01 13:15

    I had multiple ts files for my routes and what I did was import all those routes in my app.routes and then concat them all together to call forRoot:

    export const appRoutes = xRoutes.concat(zRoutes) etc

    after putting all my routes in one single file/export const statement the error/weird build behaviour disappeared.

提交回复
热议问题