Observable error

I had a good thing going with my rest calls… since updating

        let link = 'https://gamerholic.com/server/v2/get_blogs.php';
        let data_post = JSON.stringify({user_id:this.user_id,blog_category:this.category});
        let headers = new Headers({ 'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8' });
        let options = new RequestOptions({ headers: headers });
        return this.http.post(link, data_post,options)
          .map(data => data.json())
          .catch(this.handleError)


  handleError(error){
    console.error(error);
    return Observable.throw(error.json().error || 'Server error');
  }

now I get this error when building

Return type of public method from exported class has or is using name ‘ErrorObservable’ from external module “/node_modules/rxjs/observable/ErrorObservable” but cannot be named.

How do I fix please

I am running into this error too, is this something to do with the recent update?

Hi,

I am only getting this error when I try to build. I was able to remove the error by importing ErrorObservable and returning it as type ErrorObservable in my error handler.

import { ErrorObservable } from ‘rxjs/observable/ErrorObservable’;
handleError (error: any): ErrorObservable {

Hopefully this helps you guys.

2 Likes