4
respostas

Maximum call stack size exceeded

Meu código parou de funcionar após fazer a criação dos submódulos. Já refiz a criação 3 vezes e o problema permance. Estava rodando corretamente antes dessa etapa. erro:

Failed to compile.

./src/main.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
RangeError: Maximum call stack size exceeded
    at Set.add (<anonymous>)
    at new Set (<anonymous>)
    at LocalModuleScopeRegistry.getScopeOfModuleReference (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:233:38)
    at LocalModuleScopeRegistry.getExportedScope (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:533:29)
    at LocalModuleScopeRegistry.getScopeOfModuleReference (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:271:44)
    at LocalModuleScopeRegistry.getExportedScope (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:533:29)
    at LocalModuleScopeRegistry.getScopeOfModuleReference (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:271:44)
    at LocalModuleScopeRegistry.getExportedScope (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:533:29)
    at LocalModuleScopeRegistry.getScopeOfModuleReference (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:271:44)
    at LocalModuleScopeRegistry.getExportedScope (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:533:29)
    at LocalModuleScopeRegistry.getScopeOfModuleReference (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:271:44)
    at LocalModuleScopeRegistry.getExportedScope (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:533:29)
    at LocalModuleScopeRegistry.getScopeOfModuleReference (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:271:44)
    at LocalModuleScopeRegistry.getExportedScope (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:533:29)
    at LocalModuleScopeRegistry.getScopeOfModuleReference (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:271:44)
    at LocalModuleScopeRegistry.getExportedScope (/home/cponciano/Documents/Git/alurapic/node_modules/@angular/compiler-cli/src/ngtsc/scope/src/local.js:533:29)

photo.module.ts

import { CommonModule } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { PhotoComponent } from './photo.component';

@NgModule({
    declarations: [
        PhotoComponent
    ],
    imports: [
        CommonModule,
        HttpClientModule
    ],
    exports: [
        PhotoComponent
    ]
})
export class PhotoModule {

}

photo-form.module.ts

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { PhotoFormComponent } from './photo-form.component';

@NgModule({
    declarations: [
        PhotoFormComponent
    ],
    imports: [
        CommonModule
    ]
})
export class PhotoFormModule {

}

photo-list.module.ts

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { PhotoModule } from '../photos.module';
import { FilterByDescription } from './filter-by-description.pipe';
import { LoadButtonComponent } from './load-button/load-button.component';
import { PhotoListComponent } from './photo-list.component';
import { PhotosComponent } from './photos/photos.component';

@NgModule({
    declarations: [
        PhotoListComponent,
        PhotosComponent,
        LoadButtonComponent,
        FilterByDescription
    ],
    imports: [
        CommonModule,
        PhotoModule
    ]
})
export class PhotoListModule {

}

photos.module.ts

import { NgModule } from '@angular/core';

import { PhotoFormModule } from './photo-form/photo-form.module';
import { PhotoListModule } from './photo-list/photo-list.module';

@NgModule({
    imports: [
        PhotoModule,
        PhotoFormModule,
        PhotoListModule
    ]
})
export class PhotoModule {}
4 respostas

Fala ai Carla, tudo bem? Esse erro provavelmente é por conta de algum loop esteja executando eternamente.

O motivo para isso pode variar muito, sendo assim, posso te pedir um favor? Compartilha o projeto completo, assim eu consigo simular o problema por aqui e analisá-lo com mais calma.

Pode compartilhar através do Github ou Google Drive (zipado).

Fico no aguardo.

Fala Carla, tentei fazer o download do projeto, mas, na hora de descompactar está dando erro, pode ser que algo tenha sido corrompido.

Consegue subir o zip novamente com um novo link?

Fico no aguardo.

Bom Dia! Envio novamente o link:

https://drive.google.com/file/d/1_95raRrTyCVx12dN871kZpIrXU_yHSI5/view?usp=sharing

Obrigada! Att;