angular-laravel-echo icon indicating copy to clipboard operation
angular-laravel-echo copied to clipboard

Error: Cannot instantiate cyclic dependency! InjectionToken HTTP_INTERCEPTORS

Open RutsuKun opened this issue 2 years ago • 2 comments

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

RutsuKun avatar Jan 31 '23 09:01 RutsuKun

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.

chancezeus avatar Jan 31 '23 10:01 chancezeus

I will try.

RutsuKun avatar Jan 31 '23 10:01 RutsuKun