title: TypeError: You provided 'undefined' where a stream was expected
body: <p>I have an Ionic app that has a <code>user</code> provider with a <code>signup()</code> method:</p>
  
  <pre class="lang-js prettyprint-override"><code>doSignup() {
    // set login to same as email
    this.account.login = this.account.email;
    // Attempt to login in through our User service
    this.user.signup(this.account).subscribe((resp) =&gt; {
      this.navCtrl.push(MainPage);
    }, (err) =&gt; {
      //console.log('error in signup', err);
      // ^^ results in 'You provided 'undefined' where a stream was expected'
      //this.navCtrl.push(MainPage);
  
      // Unable to sign up
      let toast = this.toastCtrl.create({
        message: this.signupErrorString,
        duration: 3000,
        position: 'top'
      });
      toast.present();
    });
  }
  </code></pre>
  
  <p>For some reason, this code never calls the success callback, only the error handler. When it does, it results in the error you see in the comment above.</p>
  
  <p>My <code>user.signup()</code> method looks as follows:</p>
  
  <pre class="lang-js prettyprint-override"><code>signup(accountInfo: any) {
    return this.api.post('register', accountInfo).share();
  }
  </code></pre>
  
  <p>My <code>Api</code> class looks as follows:</p>
  
  <pre class="lang-js prettyprint-override"><code>import { HttpClient, HttpParams } from '@angular/common/http';
  import { Injectable } from '@angular/core';
  
  /**
   * Api is a generic REST Api handler. Set your API url first.
   */
  @Injectable()
  export class Api {
    public static API_URL: string = 'http://localhost:8080/api';
  
    constructor(public http: HttpClient) {
    }
  
    get(endpoint: string, params?: any, reqOpts?: any) {
      if (!reqOpts) {
        reqOpts = {
          params: new HttpParams()
        };
      }
  
      // Support easy query params for GET requests
      if (params) {
        reqOpts.params = new HttpParams();
        for (let k in params) {
          reqOpts.params.set(k, params[k]);
        }
      }
  
      return this.http.get(Api.API_URL + '/' + endpoint, reqOpts);
    }
  
    post(endpoint: string, body: any, reqOpts?: any) {
      return this.http.post(Api.API_URL + '/' + endpoint, body, reqOpts);
    }
  
    put(endpoint: string, body: any, reqOpts?: any) {
      return this.http.put(Api.API_URL + '/' + endpoint, body, reqOpts);
    }
  
    delete(endpoint: string, reqOpts?: any) {
      return this.http.delete(Api.API_URL + '/' + endpoint, reqOpts);
    }
  
    patch(endpoint: string, body: any, reqOpts?: any) {
      return this.http.put(Api.API_URL + '/' + endpoint, body, reqOpts);
    }
  }
  </code></pre>
  
  <p>I tried removing <code>share()</code> from <code>user.signup()</code>, and returning <code>Observable&lt;any&gt;</code>, but that doesn't help.</p>