Recently encountered an issue where I forgot to import certain modules, resulting in the error "Error: Maximum call stack size exceeded." Despite attempting to import the project into StackBlitz, no solution was found.
In the app.module.ts file:
import { NgModule } from '@angular/core';
...
@NgModule({
declarations: [
...
],
imports: [
...
],
providers: [...],
bootstrap: [AppComponent]
})
export class AppModule {
}
In the user-profile.component.ts file:
import { Component, OnInit } from '@angular/core';
...
export class UserProfileComponent implements OnInit {
constructor(private uploadService: UploadService) { }
...
}
In the app-routing.module.ts file:
import { NgModule } from '@angular/core';
...
const routes: Routes = [
...
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
In the upload.service.ts file:
import { Injectable } from '@angular/core';
...
@Injectable({
providedIn: 'root',
})
export class UploadService {
constructor(private afStorage: AngularFireStorage, private user: User) { }
...
}
Struggling to identify the root cause of the problem. Have made some changes but reverted back to the original code as the suspected issues did not resolve the error.