<p dir="auto">I was trying to compile my project directly to ES6 and use <a href="https://github.com/zloirock/core-js">core-js</a> for shims (they seem to cover a lot more than es6-shim), but it looks like I get a an error:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="TypeError: Cannot convert undefined or null to object
angular2.min.js:26Uncaught TypeError: Cannot read property 'getOptional' of undefinedu @ angular2.min.js:26t._initApp @ angular2.min.js:26t.application @ angular2.min.js:26n @ angular2.min.js:26(anonymous function) @ bootstrap.ts:37(anonymous function) @ bootstrap.ts:37U @ system.src.js:4597c.execute @ system.src.js:4597i @ system.src.js:4597n @ system.src.js:4597execute @ system.src.js:4597y @ system.src.js:4597w @ system.src.js:4597p @ system.src.js:4597h @ system.src.js:4597(anonymous function) @ system.src.js:4597n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:1I @ angular2.min.js:1A @ angular2.min.js:1R @ angular2.min.js:1(anonymous function) @ angular2.min.js:1n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:1h @ angular2.min.js:1h @ core.js:3055(anonymous function) @ core.js:3066e @ core.js:3310
core.js:3055 Uncaught TypeError: Cannot read property 'getOptional' of undefined
    Evaluating http://localhost:3000/app/bootstrap.js
    Error loading http://localhost:3000/app/bootstrap.jsh @ core.js:3055(anonymous function) @ core.js:3066e @ core.js:3310"><pre class="notranslate">TypeError: <span class="pl-v">Cannot</span> <span class="pl-s1">convert</span> <span class="pl-c1">undefined</span> <span class="pl-s1">or</span> <span class="pl-c1">null</span> <span class="pl-s1">to</span> <span class="pl-s1">object</span>
<span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">26</span><span class="pl-v">Uncaught</span> <span class="pl-v">TypeError</span>: <span class="pl-v">Cannot</span> <span class="pl-s1">read</span> <span class="pl-s1">property</span> <span class="pl-s">'getOptional'</span> <span class="pl-s1">of</span> <span class="pl-s1">undefinedu</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">26</span><span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-c1">_initApp</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">26</span><span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-c1">application</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">26n</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-en">js</span>:<span class="pl-c1">26</span><span class="pl-kos">(</span><span class="pl-s1">anonymous</span> <span class="pl-s1">function</span><span class="pl-kos">)</span> @ <span class="pl-s1">bootstrap</span><span class="pl-kos">.</span><span class="pl-en">ts</span>:<span class="pl-c1">37</span><span class="pl-kos">(</span><span class="pl-s1">anonymous</span> <span class="pl-s1">function</span><span class="pl-kos">)</span> @ <span class="pl-s1">bootstrap</span><span class="pl-kos">.</span><span class="pl-c1">ts</span>:<span class="pl-c1">37</span><span class="pl-v">U</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597</span><span class="pl-s1">c</span><span class="pl-kos">.</span><span class="pl-c1">execute</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597</span><span class="pl-s1">i</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597n</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597</span><span class="pl-s1">execute</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597</span><span class="pl-s1">y</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597</span><span class="pl-s1">w</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597</span><span class="pl-s1">p</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597</span><span class="pl-s1">h</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-en">js</span>:<span class="pl-c1">4597</span><span class="pl-kos">(</span><span class="pl-s1">anonymous</span> <span class="pl-s1">function</span><span class="pl-kos">)</span> @ <span class="pl-s1">system</span><span class="pl-kos">.</span><span class="pl-c1">src</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">4597n</span><span class="pl-kos">.</span><span class="pl-c1">run</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-en">js</span>:<span class="pl-c1">1</span><span class="pl-kos">(</span><span class="pl-s1">anonymous</span> <span class="pl-s1">function</span><span class="pl-kos">)</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">1</span><span class="pl-v">I</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">1</span><span class="pl-v">A</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">1</span><span class="pl-v">R</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-en">js</span>:<span class="pl-c1">1</span><span class="pl-kos">(</span><span class="pl-s1">anonymous</span> <span class="pl-s1">function</span><span class="pl-kos">)</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">1n</span><span class="pl-kos">.</span><span class="pl-c1">run</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-en">js</span>:<span class="pl-c1">1</span><span class="pl-kos">(</span><span class="pl-s1">anonymous</span> <span class="pl-s1">function</span><span class="pl-kos">)</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">1</span><span class="pl-s1">h</span> @ <span class="pl-s1">angular2</span><span class="pl-kos">.</span><span class="pl-c1">min</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">1</span><span class="pl-s1">h</span> @ <span class="pl-s1">core</span><span class="pl-kos">.</span><span class="pl-en">js</span>:<span class="pl-c1">3055</span><span class="pl-kos">(</span><span class="pl-s1">anonymous</span> <span class="pl-s1">function</span><span class="pl-kos">)</span> @ <span class="pl-s1">core</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">3066</span><span class="pl-s1">e</span> @ <span class="pl-s1">core</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">3310</span>
<span class="pl-s1">core</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">3055</span> <span class="pl-v">Uncaught</span> <span class="pl-v">TypeError</span>: <span class="pl-v">Cannot</span> <span class="pl-s1">read</span> <span class="pl-s1">property</span> '<span class="pl-s1">getOptional</span>' <span class="pl-k">of</span> <span class="pl-c1">undefined</span>
    <span class="pl-v">Evaluating</span> <span class="pl-s1">http</span>:<span class="pl-c">//localhost:3000/app/bootstrap.js</span>
    <span class="pl-v">Error</span> <span class="pl-s1">loading</span> <span class="pl-s1">http</span>:<span class="pl-c">//localhost:3000/app/bootstrap.jsh @ core.js:3055(anonymous function) @ core.js:3066e @ core.js:3310</span></pre></div>
<p dir="auto">Not sure why though. If I compile to ES5, it works perfectly fine.</p>
<p dir="auto">Here is my <code class="notranslate">tsconfig.json</code> for reference:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;compilerOptions&quot;: {
        &quot;emitDecoratorMetadata&quot;: true,
        &quot;experimentalDecorators&quot;: true,
        &quot;module&quot;: &quot;commonjs&quot;,
        &quot;moduleResolution&quot;: &quot;node&quot;,
        &quot;noImplicitAny&quot;: false,
        &quot;sourceMap&quot;: true,
        &quot;target&quot;: &quot;es5&quot;
    }
}"><pre class="notranslate"><span class="pl-kos">{</span>
    <span class="pl-s">"compilerOptions"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"emitDecoratorMetadata"</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-s">"experimentalDecorators"</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-s">"module"</span>: <span class="pl-s">"commonjs"</span><span class="pl-kos">,</span>
        <span class="pl-s">"moduleResolution"</span>: <span class="pl-s">"node"</span><span class="pl-kos">,</span>
        <span class="pl-s">"noImplicitAny"</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
        <span class="pl-s">"sourceMap"</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-s">"target"</span>: <span class="pl-s">"es5"</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Is there a reason for not using <a href="https://github.com/zloirock/core-js">core-js</a>? From the <a href="http://kangax.github.io/compat-table/es6/#typescript" rel="nofollow">es6 compat table</a> core-js covers a lot more than <a href="http://kangax.github.io/compat-table/es6/#es6shim" rel="nofollow">es6-shim</a>.</p>