NullInjectorError: No provider for Apollo

Discussão em 'Angular' iniciado por Mustafa Waqar, Março 2, 2025.

  1. I have upgraded angular 15 to 17, in which I have also updated apollo-angular from version 4 to 10 and @apollo/client as well.

    Now I am getting No provider for Apollo error.


    main.ts:12 NullInjectorError: R3InjectorError(AppModule)[AuthService -> Apollo -> Apollo]:
    NullInjectorError: No provider for Apollo!
    at NullInjector.get (core.mjs:1654:27)
    at R3Injector.get (core.mjs:3093:33)
    at R3Injector.get (core.mjs:3093:33)
    at injectInjectorOnly (core.mjs:1100:40)
    at Module.ɵɵinject (core.mjs:1106:60)
    at Object.AuthService_Factory [as factory] (auth.service.ts:22:25)
    at core.mjs:3219:47
    at runInInjectorProfilerContext (core.mjs:866:9)
    at R3Injector.hydrate (core.mjs:3218:21)
    at R3Injector.get (core.mjs:3082:33)


    I have tried up adding HTTPModule to app.module but still the same error exist.

    Continue reading...

Compartilhe esta Página