<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[X] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[X] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
When running <code class="notranslate">ngc</code> while some modules have default exports:</p>
<p dir="auto"><code class="notranslate">some-module.ts</code></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export default { foo, bar };"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-kos">{</span> foo<span class="pl-kos">,</span> bar <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><code class="notranslate">another-module.ts</code></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import someModule from &quot;./some-module&quot;;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">someModule</span> <span class="pl-k">from</span> <span class="pl-s">"./some-module"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">The compiler fails to find <code class="notranslate">someModule</code> inside <code class="notranslate">some-module.ts</code> with the following error:</p>
<p dir="auto"><code class="notranslate">can't resolve module .some-module from D:/path/to/another-module.ts</code><br>
<code class="notranslate">Error: can't find symbol undefined exported from module D:/path/to/some-module.ts</code></p>
<p dir="auto">If changed to explicitly-named exports:</p>
<p dir="auto"><code class="notranslate">some-module.ts</code></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export var someModule = { foo, bar };"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">someModule</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> foo<span class="pl-kos">,</span> bar <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><code class="notranslate">another-module.ts</code></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { someModule } from &quot;./some-module&quot;;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">someModule</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./some-module"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">It now works fine.  Obviously, the code does not handle the case of an unnamed default export.</p>
<p dir="auto"><strong>Expected behavior</strong><br>
The default export should also work.</p>
<p dir="auto"><strong>Reproduction of the problem</strong><br>
See above example.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
Windows 10.</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.0</li>
<li><strong>Browser:</strong> all</li>
<li><strong>Language:</strong> all</li>
<li><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =  v4.3.1</li>
</ul>
<p dir="auto"><strong>I'm submitting a ...</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report =&gt; search github for a similar issue or PR before submitting"><pre class="notranslate"><code class="notranslate">[x] bug report =&gt; search github for a similar issue or PR before submitting
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
To allow a module to be loaded lazily, I define its route like so:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    path: 'report',
    loadChildren: '/app/report/report.module'
}"><pre class="notranslate"><code class="notranslate">{
    path: 'report',
    loadChildren: '/app/report/report.module'
}
</code></pre></div>
<p dir="auto">And I declare it as the default class in <em>report.module.ts</em> so the router will know what to load:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export default class ReportModule {}"><pre class="notranslate"><code class="notranslate">export default class ReportModule {}
</code></pre></div>
<p dir="auto">Using <code class="notranslate">export default class ReportModule {}</code> instead of <code class="notranslate">export class ReportModule {}</code> when declaring modules breaks <code class="notranslate">ngc</code>.  During compilation I get error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="can't resolve module C:/path/to/report.module.ts from C:/path/to/report.module.ts
Error: can't find symbol ReportModule exported from module C:/path/to/report.module.ts
    at ReflectorHost.findDeclaration (C:\path\to\@angular\compiler-cli\src\reflector_host.js:174:23)
    at _loop_1 (C:\path\to\@angular\compiler-cli\src\codegen.js:52:51)
    ...
Compilation failed"><pre class="notranslate"><code class="notranslate">can't resolve module C:/path/to/report.module.ts from C:/path/to/report.module.ts
Error: can't find symbol ReportModule exported from module C:/path/to/report.module.ts
    at ReflectorHost.findDeclaration (C:\path\to\@angular\compiler-cli\src\reflector_host.js:174:23)
    at _loop_1 (C:\path\to\@angular\compiler-cli\src\codegen.js:52:51)
    ...
Compilation failed
</code></pre></div>
<p dir="auto">I left the orientation of the slashes (forward <code class="notranslate">/</code> and back <code class="notranslate">\</code>) as they appear in the console</p>
<p dir="auto"><strong>Expected/desired behavior</strong></p>
<p dir="auto">An earlier version of <a href="https://angular.io/docs/ts/latest/guide/ngmodule.html" rel="nofollow">the docs</a> on <code class="notranslate">ngModule</code> suggested using <code class="notranslate">export default</code> to expose lazy-loaded modules. This works well with Just-in-Time compilation. So I expected the AoT compiler to be able to parse them as well</p>
<p dir="auto"><strong>Reproduction of the problem</strong></p>
<p dir="auto">Try compiling an application with a module declared with <code class="notranslate">export default</code></p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.0-rc.6</li>
<li><strong>Browser:</strong> [all]</li>
<li><strong>Language:</strong> [TypeScript 2]</li>
</ul>