Compilation fails when using lazy loading feature modules
See original GitHub issueVersions
Angular CLI: 6.0.0
Node: 8.11.1
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.0
@angular-devkit/build-angular 0.6.0
@angular-devkit/build-optimizer 0.6.0
@angular-devkit/core 0.6.0
@angular-devkit/schematics 0.6.0
@ngtools/webpack 6.0.0
@schematics/angular 0.6.0
@schematics/update 0.6.0
rxjs 6.1.0
typescript 2.7.2
webpack 4.6.0
Repro steps
- ng new test-cli --routing
- ng generate module orders --routing
- Add the following to the route config
{
path: 'orders',
loadChildren: 'app/orders/orders.module#OrdersModule'
}
- ng serve
Observed behavior
ERROR in Could not resolve module app/orders/orders.module relative to /Users/Sam/Developer/test-cli/src/app/app-routing.module.ts
ℹ 「wdm」: Failed to compile.
Desired behavior
Compilation completes successfully
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Lazy-loading feature modules - Angular
To lazy load Angular modules, use loadChildren (instead of component ) in your AppRoutingModule routes configuration as follows. AppRoutingModule (excerpt)
Read more >Error when trying to lazy load feature modules using angular ...
I tried using lazy loading with angular-cli(beta.17) and it worked for me. As per my understanding,. SystemJs - we need to give full...
Read more >Resolving errors faced while implementing Lazy Loading with ...
I've been building a travel planning web application at www.awaynation.com with Angular 5. As it is a single-page application, it takes very ...
Read more >Lazy Loading In Angular - C# Corner
Lazy loading feature allows loading components, modules, and other files of Angular application when required.
Read more >Making sure lazy loaded modules don't import services from ...
One library per feature module · One library for every shared thing - 1 library for the shared components, 1 library for the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Does this work?
loadChildren: './orders/orders.module#OrdersModule'
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.