• Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Precios
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

799
Vistas
NG0200: Circular dependency in DI detected for ApplicationRef

I got the following error while refactoring the app:

main.ts:21 Error: NG0200: Circular dependency in DI detected for ApplicationRef. Find more at https://angular.io/errors/NG0200
    at throwCyclicDependencyError (core.js:216)
    at R3Injector.hydrate (core.js:11433)
    at R3Injector.get (core.js:11256)
    at injectInjectorOnly (core.js:4751)
    at Module.ɵɵinject (core.js:4755)
    at Object.Config_Factory [as factory] (config.ts:7)
    at R3Injector.hydrate (core.js:11437)
    at R3Injector.get (core.js:11256)
    at injectInjectorOnly (core.js:4751)
    at Module.ɵɵinject (core.js:4755)

But I haven't found any circular dependencies. What else can be the cause?

10 months ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

It was caused by injecting a custom service into ErrorHandler:

@Injectable()
export class GlobalErrorHandler extends ErrorHandler {
  /*constructor(protected readonly customService: CustomService) {
    super();
  }*/
}

Seems like only Angular's services (like HttpClient) can be injected there.

10 months ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.