title: Rxjs error type 'Observable<HttpEvent<any>>'
body: <p>I've recently upgraded my rxjs packages. However my Angular interceptor is now erroring. Here is my code:</p>
  <pre><code>import { HttpEvent, HttpHandler, HttpResponse, HttpInterceptor, HttpRequest, HttpErrorResponse } from '@angular/common/http';
  import { Observable, tap, catchError } from 'rxjs';
  import { Injectable } from '@angular/core';
  import { BusyService } from './shared/services/busy.service';
  import { Router } from &quot;@angular/router&quot;;
  
  @Injectable()
  export class ProgressInterceptor implements HttpInterceptor {
  
      
  
      constructor(private router: Router, private busyService: BusyService) { }
  
      intercept(req: HttpRequest&lt;any&gt;, next: HttpHandler): Observable&lt;HttpEvent&lt;any&gt;&gt; {
          
  
          return next.handle(req).pipe(
              tap((event: HttpEvent&lt;any&gt;) =&gt; {
                  
  
                  // Only enable and disable buttons if the skip interceptor was NOT set as a header on that call
                  if ((req.headers.get('X-Skip-Interceptor') != &quot;True&quot;)) {
  
                      
  
                      // If request was sent
                      if ((event.type == 0)) {
                          //console.log(&quot;busy&quot;);
                          this.busyService.changeBusy(true);
                      }
                      else {
                          //console.log(&quot;not busy&quot;);
                          this.busyService.changeBusy(false);
                      }
  
                  }
  
              }),
              catchError((err: HttpErrorResponse) =&gt; {
  
                  
  
                  let errorReceived;
  
                  if ((typeof err == 'string'))
                  {
                      errorReceived = JSON.parse(err);
                  }
                  else
                  {
                      errorReceived = err;
                  }
  
                  this.busyService.changeBusy(false);
                  
  
                  return Observable.throw(err);
              }));
  
          
      }
  }
  </code></pre>
  <p>Here is the error:</p>
  <pre><code>Error: src/app/progress.interceptor.ts:17:9 - error TS2322: Type 'Observable&lt;unknown&gt;' is not assignable to type 'Observable&lt;HttpEvent&lt;any&gt;&gt;'.
    Type 'unknown' is not assignable to type 'HttpEvent&lt;any&gt;'.
      Property 'type' is missing in type '{}' but required in type 'HttpUserEvent&lt;any&gt;'.
  
   17         return next.handle(req).pipe(
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   18             tap((event: HttpEvent&lt;any&gt;) =&gt; {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ...
   65                 return Observable.throw(err);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   66             }));
      ~~~~~~~~~~~~~~~~
  
    node_modules/@angular/common/http/http.d.ts:3861:5
      3861     type: HttpEventType.User;
               ~~~~
      'type' is declared here.
  
  
  Error: src/app/progress.interceptor.ts:65:35 - error TS2339: Property 'throw' does not exist on type 'typeof Observable'.
  
  65                 return Observable.throw(err);
  </code></pre>
  <p>There is zero information out there that I can find to update the intercept code. The error isn't even helpful as it's referencing a node module file that I shouldn't edit.</p>