title: Angular: Cannot read property 'call' of undefined (when bootstrapping)
body: <p>Check the update on the bottom!</p>
  
  <p>I have a service that throws an error while the app is bootstrapping. <code>Cannot read property 'call' of undefined</code>. I'm using ng2 2.4.2 and angular-cli 1.0.0-beta.24.</p>
  
  <p>ERROR</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'call' of undefined at webpack_require (bootstrap 81b10f8…:52) at Object.621 (environment.ts:8) at webpack_require (bootstrap 81b10f8…:52) at Object.450 (src async:7) at webpack_require (bootstrap 81b10f8…:52) at Object.1057 (util.service.ts:35) at webpack_require (bootstrap 81b10f8…:52) at webpackJsonpCallback (bootstrap 81b10f8…:23) at main.bundle.js:1 </p>
  </blockquote>
  
  <p>As you can see it's a problem with the util service - this looks as follows:
  </p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Router } from '@angular/router';
  import { Project } from '../datatypes/';
  import { Response } from '@angular/http';
  
  
  @Injectable()
  export class UtilService {
      constructor(private router: Router) {}
  
      public redirectToProject(project: Project) {
          let query = project.ProjectName.split(' ')
              .join('-')
              .concat('-' + project.Id)
              .toLowerCase();
          this.router.navigate(['/project', query]);
      }
  
      public extractData(res: Response) {
          let body = res.json();
          return body || {};
      }
  }
  </code></pre>
  
  <p>Strange: When inspecting the source file in chrome it has no syntax highlighting, which would suggest a syntax error - in my opinion there's none though.</p>
  
  <h2>Update January 20. 2017</h2>
  
  <p>I updated to ng2.4.4 and angular-cli 1.0.0-beta26. The problem is still the same.
  While playing around, Arjan found out that it works with beta 21. Will have to check the changes. The problem now isn't in the service above but in the <code>environment.ts</code> file (which has all the defaults).</p>