0

I am facing this issue when i am enableIvy in my Angular project and if enableIvy is off it is working fine, recently i have updated for Angular 7 to 9.

 CLI Version
"@angular/cli": "^9.1.3",
"@angular/compiler-cli": "^9.1.3"


Error: Cannot instantiate cyclic dependency! InjectionToken HTTP_INTERCEPTORS
at throwCyclicDependencyError (core.js:5554)
at R3Injector.push../node_modules/@angular/core/__ivy_ngcc__/fesm5/core.js.R3Injector.hydrate (core.js:11618)
at R3Injector.push../node_modules/@angular/core/__ivy_ngcc__/fesm5/core.js.R3Injector.get (core.js:11439)
at HttpInterceptingHandler.push../node_modules/@angular/common/__ivy_ngcc__/fesm5/http.js.HttpInterceptingHandler.handle (http.js:1997)
at MergeMapSubscriber.project (http.js:1123)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._tryNext (mergeMap.js:61)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._next (mergeMap.js:51)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:53)
at Observable._subscribe (subscribeToArray.js:5)
at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe (Observable.js:43)
James Z
  • 12,209
  • 10
  • 24
  • 44
Satnam Singh
  • 63
  • 1
  • 13
  • Please include the code that you have relevant to http interceptors you have and also how they are registered. – Igor Apr 28 '20 at 14:33
  • Actually it is third party Module/library which calls api from its service fie. same like ngx-logger for logging – Satnam Singh Apr 28 '20 at 14:57
  • You can check [here](https://stackoverflow.com/questions/47091872/angular-4-cannot-instantiate-cyclic-dependency-injectiontoken-http-interceptor) – Mahipal Choudhary Apr 28 '20 at 15:12
  • My scenario is different and i am facing issue only i am enabling the IVY on my project.If it is off no issue is there. – Satnam Singh Apr 28 '20 at 15:54
  • 1
    I've the same problem with two projects updated from 8 to 9, still looking for a solution :'( – Booster2ooo May 12 '20 at 06:35

0 Answers0