Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

331
Views
Angular 12 : router-outlet is not rendering the component after upgrade to dymamic import of router module

I have changed my router import from old way of importing

loadChildren: './lazy/lazy.module#LazyModule

I have used dynamic import to load the router module.

loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule)

Now, my is not rendering the components but at the same time header and footer, component are loading fine since it is not loaded from the router-outlet.

app.component.html

<header-component>.  //rendering fine
<router-outlet></router-outlet>. // I am seeing it gets routed in the address bar, but the component is not getting rendering.
<footer-component> //rendering fine 

I don't get any error on the console or vscode for the above issue. How do I debug this issue while the components are blank though it is routed correctly also I am getting an API response for this component in the network tab the API response is not get rendered on the screen as HTML.

This issue happened to me while I am upgrading from Angular 11 to the 12 version.

My detailed code structure is pretty same like this document https://remotestack.io/angular-lazy-load-modules-with-dynamic-module-imports-example/

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

@JSBeginner please share your LazyModule code, and it seems you need to specify how you configured routes in the LazyModule module

for example

const routes: Routes = [
  {
    path: '',
    component: LazyComponent],
  },
];

and add this line of code on imports of lazyModule

RouterModule.forChild(routes),
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!