I have an Angular 2 (angular cli 1.3.2) project which is broken down into multiple modules with lazy loading. The main module uses the following code to load the sub-modules inside my router:
{
path: 'module2',
loadChildren: 'modules/module2/module2.module.ts#Module2Module',
canActivate: [Guard]
},
When I run ng serve it gives the following error message:
ERROR in Could not resolve "modules/module2/module2.module.ts" from "<..>/app/app.module.ts".
When I save any file in the project (triggering a re-build) the build is successful and both modules work as expected. I don't even need to change the file!
Is there a way to resolve this issue, or could this be a bug?
Thanks
Module2Modulefro ma wrong path. Could it be./modules/module2/module2.module.ts#Module2Module?