0

I have refactored my Angular app by moving all business logic in a separated library in the same workspace. The datasource is now in the library and when calling httpClient.get<whatever>('whereever') or any other http request, it gets completely ignored. Even SVG mat-icons do not make the call to retrieve the SVG (I double checked the MatIconRegistry and DomSanitizer) if used inside a component in the library.

I came across this SO question where things gets strange if HttpClient gets declared multiple times in the import hierarchy, so I moved the HttpClientModule import in the app only, but no luck.

There is no error whatsoever in the console, which is kinda strange, and the debugger can stop on the line of the service that makes the http request but subscribing does not trigger any XHR request (which I double checked by looking at the Chrome network debug window and by setting a break point in an HttpInterceptor at the beginning of intercept()).

Any idea of what may cause the issue?

Of course all classes and respective requests where working before the refactoring.

Lamberto Basti
  • 478
  • 1
  • 6
  • 24
  • Are you subscribing to the returned Observable, see [Angular 2 http.post() is not sending the request](https://stackoverflow.com/q/36208732/1260204)? If that is not it you need to create and share a [mcve]. – Igor Dec 01 '20 at 18:24
  • Of course I am subscribing! I will work on a mre as soon as I can – Lamberto Basti Dec 01 '20 at 18:30
  • 1
    update your post on how your are importing the `HttpClientModule` and how your importing your Interceptor, including your Interceptor example code. – Lucho Dec 01 '20 at 20:24

1 Answers1

0

Turns out it was a Observable.zip wrongly used:

zip([o1, o2])

instead of:

zip(o1, o2)

I took me 48h to find this issue since no error was printed out!

Lamberto Basti
  • 478
  • 1
  • 6
  • 24