title: rxjs__WEBPACK_IMPORTED_MODULE_1__.Observable.throw is not a function
body: <p>I am using Angular 6 with rxjs^6.0.0 and rxjs-compat^6.5.2 but I am getting the following error which I can't resolve:</p>
  
  <blockquote>
    <p>rxjs__WEBPACK_IMPORTED_MODULE_1__.Observable.throw is not a function</p>
  </blockquote>
  
  <p>I have tried the following solutions with no success:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/45464852/rxjs-observable-throw-is-not-a-function-angular4">&quot;rxjs&quot; observable.throw is not a function - Angular4</a></li>
  <li><a href="https://stackoverflow.com/questions/50602511/typeerror-rxjs-webpack-imported-module-2-observable-throw-is-not-a-function/50841287">TypeError: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable.throw is not a function</a></li>
  <li><a href="https://github.com/reactivex/rxjs/issues/4070" rel="nofollow noreferrer">https://github.com/reactivex/rxjs/issues/4070</a></li>
  </ul>
  
  <p>This is the code that I'm using:</p>
  
  <pre><code>import { Injectable, Inject } from "@angular/core";
  import { HttpClient } from "@angular/common/http";
  import { BehaviorSubject, throwError } from 'rxjs';
  import { Observable } from 'rxjs/Observable';
  import { map, tap, mergeMap } from 'rxjs/Operators';
  import { Login } from "./login/login";
  import { CurrentUser } from "./login/current-user";
  import { Registration } from "./registrations/registration";
  
  @Injectable()
  export class AuthenticationService {
    private currentUserSubject: BehaviorSubject&lt;CurrentUser&gt;;
    public currentUser: Observable&lt;CurrentUser&gt;;
  
    constructor(private httpClient: HttpClient,
      @Inject("BASE_API_URL") private baseUrl: string) {
      this.currentUserSubject = new BehaviorSubject&lt;CurrentUser&gt;(JSON.parse(localStorage.getItem('currentUser')));
      this.currentUser = this.currentUserSubject.asObservable();
    }
  
    public get currentUserValue(): CurrentUser {
      return this.currentUserSubject.value;
    }
  
    signIn&lt;T&gt;(login: Login) {
      return this.httpClient.post&lt;T&gt;(`${this.baseUrl}api/authentication/login`, login)
        .pipe(mergeMap(loginResult =&gt; {
          return this.httpClient.get&lt;Registration&gt;(`${this.baseUrl}api/users/${loginResult.user.id}/registration`)
            .pipe(map(registration =&gt; {
              if (registration.registrationStatusId == 1)
                return throwError('Registration is pending approval.');
              else if (registration.registrationStatusId == 3)
                return throwError('Registration has been rejected.');
  
              let currentUser = new CurrentUser();
              currentUser.identity = registration;
              currentUser.identity.user = loginResult.user;
              currentUser.token = loginResult.token;
              currentUser.refreshToken = loginResult.refreshToken;
  
              localStorage.setItem('currentUser', JSON.stringify(currentUser));
              this.currentUserSubject.next(currentUser);
            }));
        }));
    }
  }
  </code></pre>