question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compilation fails when using lazy loading feature modules

See original GitHub issue

Versions

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:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
intellixcommented, May 4, 2018

Does this work? loadChildren: './orders/orders.module#OrdersModule'

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found