title: Angular 2 "require is not defined"
body: <p>I am working on an app, which previously worked. I am now trying to add some routing, so have created an app.component file and changed a few parameters, but now I just get a blank screen and this error in the console...</p>
  
  <pre><code>Error: ReferenceError: require is not defined
          at eval (http://localhost:3000/client/dev/main.js:2:17)
          at eval (http://localhost:3000/client/dev/main.js:6:3)
          at $ (http://localhost:3000/node_modules/systemjs/dist/system-polyfills.js:4:8740)
      Evaluating http://localhost:3000/client/dev/main.js
      Error loading http://localhost:3000/client/dev/main.js
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/MA48d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MA48d.png" alt="enter image description here"></a>
  My Main.JS file is:</p>
  
  <pre><code>"use strict";
  var browser_1 = require('angular2/platform/browser');
  var app_component_1 = require('./app.component');
  browser_1.bootstrap(app_component_1.AppComponent);
  </code></pre>
  
  <p>This is Generated from <code>main.ts</code>:</p>
  
  <pre><code>import { bootstrap }    from 'angular2/platform/browser';
  import { AppComponent } from './app.component';
  
  bootstrap(AppComponent);
  </code></pre>
  
  <p>Whats's wrong with this?</p>
  
  <h1>Update:</h1>
  
  <p>Thanks Eric for your suggestion about using the system module in tsconfig.json, but if I do it, I get the following error:</p>
  
  <pre><code>C:\Users\George\Source\Repos\Gen-App\server\server.js:2
  System.register(['express', 'os', 'http', './config/routes.conf', './config/db.conf', './config/passport', './routes/index'], function(exports_1, context_1) {
  ^
  
  ReferenceError: System is not defined
      at Object.&lt;anonymous&gt; (C:\Users\George\Source\Repos\Gen-App\server\server.js:2:1)
      at Module._compile (module.js:413:34)
      at Object.Module._extensions..js (module.js:422:10)
      at Module.load (module.js:357:32)
      at Function.Module._load (module.js:314:12)
      at Module.require (module.js:367:17)
      at require (internal/module.js:16:19)
      at Object.&lt;anonymous&gt; (C:\Users\George\Source\Repos\Gen-App\index.js:1:63)
      at Module._compile (module.js:413:34)
      at Object.Module._extensions..js (module.js:422:10)
  </code></pre>
  
  <p>NB: my server.js code is <a href="https://github.com/georgeedwards/Gen-App/blob/master/server/server.ts" rel="nofollow noreferrer">here</a></p>