chancezeus / angular-laravel-echo

A Angular service for working with laravel-echo
MIT License
18 stars 21 forks source link

Error: Cannot instantiate cyclic dependency! InjectionToken HTTP_INTERCEPTORS #19

Open RutsuKun opened 1 year ago

RutsuKun commented 1 year ago

image In my application, I don't use HTTP_INTERCEPTORS. I can't share the source code because the application is confidential.

chancezeus commented 1 year ago

Instead of using forRoot you can instead manually provide the service and config (see: https://github.com/chancezeus/angular-laravel-echo/blob/master/src/lib/src/module.ts#L20)

The "easy" version using the module does have an interceptor that automatically injects the socket id in the request, but the library itself will never cause a circular dependency (which would only happens if the service would (indirectly) rely on HttpClient), so the cause of this is somewhere in another library and/or your own application code.

To provide more details I will need a reproduction repo so I can check what goes wrong, just the stacktrace doesn't tell me anything since this error is directly related to everything else in the application.

RutsuKun commented 1 year ago

I will try.