Angular2 http.get throws EXCEPTION: Error: Uncaught (in promise): Cannot read property 'toString' of null
<p>Today I have come across an error thrown by get method of Http module of Angular2 and it took me a while to figure out the solution so I decided to put it here and make someones life less painful. Otherwise, if you like to spend hours debugging angular/core then don't read it :).</p>

<p>My use case is about sending GET request without body payload with jwt token set to header like this:</p>

<pre class="lang-js prettyprint-override"><code>let headers = new Headers();

headers.append('Content-Type', 'application/json');
headers.append('Authorization', token);

let options = new RequestOptions({
    headers: headers
});
</code></pre>



<p>And then I was making a get request to localhost where I have server running:</p>

<pre class="lang-js prettyprint-override"><code>return this.http.get('http://localhost:3000/someApiUrl', options)
    .toPromise()
    .then(this.extractData)
    .catch(this.handleError);
</code></pre>



<p>But whatever I do Angular is throwing an exception</p>

<pre class="lang-js prettyprint-override"><code>EXCEPTION: Error: Uncaught (in promise): Cannot read property 'toString' of null
</code></pre>