Angular throws Error: NG0205: Injector has already been destroyed. error properties: Object({...

Discussão em 'Angular' iniciado por DerHaendler, Fevereiro 26, 2025.

  1. DerHaendler

    DerHaendler Guest

    Hey Devs,

    I'm facing an issue where the following error is thrown during Karma test execution:

    Error: NG0205: Injector has already been destroyed.
    error properties: Object({ code: 205 })


    The error started occurring after upgrading from Angular 17 to 19 and only happens in the Jenkins pipeline—it does not appear in my local macOS development setup.

    The error is not related to a specific test; it is always thrown after the last test finishes.

    My project has a custom Docker setup with a Node container. Inside the container, the Angular CLI is installed, and the tests are executed. The Angular version and dependencies should be the same in both environments.

    I've already tried the solutions from other posts with the same problem, but nothing has worked so far.

    My application contains hundreds of tests, so manually modifying each test to find the root cause is not a practical option.

    Do you have any ideas or tipps i can solve the problem? Or atleast recreate it locally for better testing?

    Continue reading...

Compartilhe esta Página