Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

340
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda