title: angular2 failing lodash import
body: <p>I started simple Angular 2 app, all working. But when I add import of lodash and try to use it, I get errors and the app stops working, and can't figure out what is the problem.</p>
  
  <p><strong>I am getting these 2 errors in console:</strong></p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Unexpected token &lt;__exec @ system.src.js:1374entry.execute @ system.src.js:3300linkDynamicModule @ system.src.js:2921link @ system.src.js:2764execute @ system.src.js:3096doDynamicExecute @ system.src.js:715link @ system.src.js:908doLink @ system.src.js:569updateLinkSetOnLoad @ system.src.js:617(anonymous function) @ system.src.js:430run @ angular2-polyfills.js:138zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$$internal$$tryCatch @ angular2-polyfills.js:1511lib$es6$promise$$internal$$invokeCallback @ angular2-polyfills.js:1523lib$es6$promise$$internal$$publish @ angular2-polyfills.js:1494(anonymous function) @ angular2-polyfills.js:243run @ angular2-polyfills.js:138zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$asap$$flush @ angular2-polyfills.js:1305
    angular2-polyfills.js:138 </p>
    
    <p>Uncaught SyntaxError: Unexpected token &lt;
    Evaluating <a href="http://localhost:3000/lodash" rel="nofollow">http://localhost:3000/lodash</a>
    Error loading <a href="http://localhost:3000/app/app.jsrun" rel="nofollow">http://localhost:3000/app/app.jsrun</a> @ angular2-polyfills.js:138zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$$internal$$tryCatch @ angular2-polyfills.js:1511lib$es6$promise$$internal$$invokeCallback @ angular2-polyfills.js:1523lib$es6$promise$$internal$$publish @ angular2-polyfills.js:1494lib$es6$promise$$internal$$publishRejection @ angular2-polyfills.js:1444(anonymous function) @ angular2-polyfills.js:243run @ angular2-polyfills.js:138zoneBoundFn @ angular2-polyfills.js:111lib$es6$promise$asap$$flush @ angular2-polyfills.js:1305</p>
  </blockquote>
  
  <p><strong>FILES</strong></p>
  
  <p><strong>index.html</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
    &lt;head&gt;
      &lt;title&gt;Angular 2 QuickStart&lt;/title&gt;
  
      &lt;!-- 1. Load libraries --&gt;
      &lt;!-- IE required polyfills, in this exact order --&gt;
      &lt;script src="node_modules/es6-shim/es6-shim.min.js"&gt;&lt;/script&gt;
      &lt;script src="node_modules/systemjs/dist/system-polyfills.js"&gt;&lt;/script&gt;
  
      &lt;script src="node_modules/angular2/bundles/angular2-polyfills.js"&gt;&lt;/script&gt;
      &lt;script src="node_modules/systemjs/dist/system.src.js"&gt;&lt;/script&gt;
      &lt;script src="node_modules/rxjs/bundles/Rx.js"&gt;&lt;/script&gt;
      &lt;script src="node_modules/angular2/bundles/angular2.dev.js"&gt;&lt;/script&gt;
  
      &lt;!-- 2. Configure SystemJS --&gt;
      &lt;script&gt;
        System.config({
          packages: {
            app: {
              format: 'register',
              defaultExtension: 'js'
            }
          }
        });
        System.import('app/app')
              .then(null, console.error.bind(console));
      &lt;/script&gt;
  
    &lt;/head&gt;
  
    &lt;!-- 3. Display the application --&gt;
    &lt;body&gt;
      &lt;my-app&gt;Loading...&lt;/my-app&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>tsconfig.json</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "compilerOptions": {
      "target": "es5",
      "module": "system",
      "moduleResolution": "node",
      "sourceMap": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "removeComments": false,
      "noImplicitAny": false
    },
    "exclude": [
      "node_modules"
    ]
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>package.json</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "name": "angular2-quickstart",
    "version": "1.0.0",
    "scripts": {
      "tsc": "tsc",
      "tsc:w": "tsc -w",
      "lite": "lite-server",
      "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
    },
    "license": "ISC",
    "dependencies": {
      "angular2": "2.0.0-beta.2",
      "es6-promise": "^3.0.2",
      "es6-shim": "^0.33.3",
      "lodash": "^4.1.0",
      "reflect-metadata": "0.1.2",
      "rxjs": "5.0.0-beta.0",
      "systemjs": "0.19.6",
      "zone.js": "0.5.10"
    },
    "devDependencies": {
      "concurrently": "^1.0.0",
      "lite-server": "^1.3.4",
      "typescript": "^1.7.5"
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import {bootstrap}    from 'angular2/platform/browser'
  import {Component} from 'angular2/core';
  import * as _ from 'lodash';
  
  @Component({
      selector: 'my-app',
      template: '&lt;h1&gt;My First Angular 2 App with lodash&lt;/h1&gt;'
  })
  export class AppComponent {
  
      constructor(){
        console.log(_.last([1, 2, 3]));
       console.log('hello');
      }
  
  }
  
  bootstrap(AppComponent);</code></pre>
  </div>
  </div>
  </p>