Webpacked Angular2 app TypeError: Cannot read property 'getOptional' of undefined <p>I've seen a lot of people having this issue, with a solution relating to angular2-polyfills.js. I'm already including this file in my webpack, however:</p> <pre><code>entry: { 'angular2': [ 'rxjs', 'zone.js', 'reflect-metadata', 'angular2/common', 'angular2/core', 'angular2/router', 'angular2/http', 'angular2/bundles/angular2-polyfills' ], 'app': [ './src/app/bootstrap' ] } </code></pre> <p>Despite this, I get the following errors when trying to load my root component:</p> <pre><code>Cannot resolve all parameters for 'ResolvedMetadataCache'(?, ?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ResolvedMetadataCache' is decorated with Injectable. Uncaught TypeError: Cannot read property 'getOptional' of undefined </code></pre> <p>Both from <code>dom_element_schema_registry:43</code>. What am I doing wrong?</p> <p>Below is the component file in question.</p> <pre><code>import {Component} from 'angular2/core'; import {MapComponent} from './map/map.component'; declare var window: any; var $ = require('jquery'); window.$ = $; window.jQuery = $; @Component({ selector: 'app', template: require('./app.component.jade'), styles: [], directives: [MapComponent] }) export class AppComponent {} </code></pre> <p><strong>EDIT</strong> This may be to do with my use of jade-loader; when I switch to requiring a raw HTML file, I get a different error:</p> <pre><code>dom_element_schema_registry.ts:43 Uncaught EXCEPTION: Error during instantiation of Token Promise&lt;ComponentRef&gt;!. ORIGINAL EXCEPTION: RangeError: Maximum call stack size exceeded ORIGINAL STACKTRACE: RangeError: Maximum call stack size exceeded at ZoneDelegate.scheduleTask (http://localhost:3000/angular2.bundle.js:20262:28) at Zone.scheduleMicroTask (http://localhost:3000/angular2.bundle.js:20184:41) at scheduleResolveOrReject (http://localhost:3000/angular2.bundle.js:20480:16) at ZoneAwarePromise.then [as __zone_symbol__then] (http://localhost:3000/angular2.bundle.js:20555:19) at scheduleQueueDrain (http://localhost:3000/angular2.bundle.js:20361:63) at scheduleMicroTask (http://localhost:3000/angular2.bundle.js:20369:11) at ZoneDelegate.scheduleTask (http://localhost:3000/angular2.bundle.js:20253:23) at Zone.scheduleMicroTask (http://localhost:3000/angular2.bundle.js:20184:41) at scheduleResolveOrReject (http://localhost:3000/angular2.bundle.js:20480:16) at ZoneAwarePromise.then [as __zone_symbol__then] (http://localhost:3000/angular2.bundle.js:20555:19) </code></pre>