Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

270
Visualizações
Angular Routes - RangeError: Maximum call stack size exceeded

I'm using Angular 12 and I'm getting the following error as a result of my routes setup: RangeError: Maximum call stack size exceeded.

My app.routes.ts is configured to bring in routes from different files. I currently have approximately 580 routes configured as below:

import { accountRoutes } from "./routes/app.routes.account";

export var routes: Routes = [
// a few top level routes defined here
];

routes = routes.concat(accountRoutes);
routes = routes.concat(fileOne);
routes = routes.concat(fileTwo);

This was working fine until I tried to add another route and I started to get the call stack error. There are no issues with the route itself as if I remove several other routes, it works as expected.

I've tried using a for loop instead of array.concat, I've also tried using the spread syntax but I get the same error.

Currently my workaround is to add new routes directly to app.routes.ts rather than trying to bring them in from another file.

Can someone please help explain the following:

  1. Why does my workaround work - the routes array is the same size in both cases
  2. If the Angular app is already loaded and I navigate to the most recent route I added, the error doesn't occur, it only occurs if I refresh the page from that route
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda