title: Angular5 handleErrors with Observable : error Observable.throw is not a function
body: <p>could you please help me to fix this error ?</p>
  
  <p><strong>core.js:1542 ERROR TypeError: rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable.throw is not a function</strong></p>
  
  <p><strong>Angular CLI: 6.0.8 / rxjs 6.2.1</strong></p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { User } from './../classes/user';
  import { AppSettings } from './appSettings';
  import { HttpClient,HttpHeaders, HttpParams } from '@angular/common/http';
  import { Observable, throwError } from 'rxjs';
  import { catchError, retry } from 'rxjs/operators';
  
  @Injectable({
        providedIn: 'root'
  })
  
  export class LoginService {
  
        constructor(private http: HttpClient){ }
  
        login(user:User): Observable&lt;User&gt; {                               
              return this.http.post&lt;User&gt;(AppSettings.BASE_URL + "/login",user)
              .pipe(catchError(this.handleServerError));   
        }
  
        handleServerError(error: any  | any) {
              console.log(error.error || error.json() || error);
              return Observable.throw(error.error || error.json() || error || 'Server error');  &lt;&lt;&lt; ERROR
        }
  
  }
  </code></pre>