<p dir="auto">As I am already including:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;node/node.d.ts&quot;: {
    &quot;commit&quot;: &quot;e850b6ac0d59fee86dd7cb6a1be2caf6400bde14&quot;
}"><pre class="notranslate"><span class="pl-s">"node/node.d.ts"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"commit"</span>: <span class="pl-s">"e850b6ac0d59fee86dd7cb6a1be2caf6400bde14"</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">In my <code class="notranslate">tsd.json</code> file and angular also includes those, I get lots of <code class="notranslate">error TS2300: Duplicate identifier ...</code> errors.</p>
<p dir="auto">Is there really no solution for this? If there is a solution, can someone point me to it because I cannot find something that would make it work, besides me not including these typings in my own <code class="notranslate">tsd.json</code> file.</p>
<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
[ ] 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
[ ] 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></p>
<p dir="auto">ngc is creating the following code for app.component.ngfactory.ts</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="...
import * as import9 from '@angular/core/src/change_detection/change_detection';
import * as import10 from '@angular/router/src/router_outlet_map';
import * as import11 from '@angular/core/src/linker/component_factory_resolver';
import * as import12 from '@angular/core/src/metadata/view';
import * as import13 from '@angular/core/src/linker/component_factory_resolver';
import * as import14 from './model/navigation.service';
import * as import15 from '@angular/router/src/router';
..."><pre class="notranslate">...
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">import9</span> <span class="pl-k">from</span> <span class="pl-s">'@angular/core/src/change_detection/change_detection'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">import10</span> <span class="pl-k">from</span> <span class="pl-s">'@angular/router/src/router_outlet_map'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">import11</span> <span class="pl-k">from</span> <span class="pl-s">'@angular/core/src/linker/component_factory_resolver'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">import12</span> <span class="pl-k">from</span> <span class="pl-s">'@angular/core/src/metadata/view'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">import13</span> <span class="pl-k">from</span> <span class="pl-s">'@angular/core/src/linker/component_factory_resolver'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">import14</span> <span class="pl-k">from</span> <span class="pl-s">'./model/navigation.service'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">import15</span> <span class="pl-k">from</span> <span class="pl-s">'@angular/router/src/router'</span><span class="pl-kos">;</span>
...</pre></div>
<p dir="auto">Notice that import11 and import13 refer to the same file. This creates a naming conflict which in turn breaks dependency injection (No provider found for ComponentFactoryResolver$1) when used with rollup.js. Even if that weren't the case, this would unnecessarily increase the project's code size.</p>
<p dir="auto">The original app.component.ts file looks like this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { Component }                    from '@angular/core';
import { RouterOutlet }                 from '@angular/router';
import { SelectorPageComponent }        from './pages/selector.component';
import { NavigationService }            from './model/navigation.service';

@Component({
    selector: 'my-app',
    directives: [RouterOutlet],
    providers: [NavigationService],
    template: '&lt;router-outlet&gt;&lt;/router-outlet&gt;',
    precompile: [ SelectorPageComponent ]
})
export class AppComponent {}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Component</span> <span class="pl-kos">}</span>                    <span class="pl-k">from</span> <span class="pl-s">'@angular/core'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">RouterOutlet</span> <span class="pl-kos">}</span>                 <span class="pl-k">from</span> <span class="pl-s">'@angular/router'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">SelectorPageComponent</span> <span class="pl-kos">}</span>        <span class="pl-k">from</span> <span class="pl-s">'./pages/selector.component'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">NavigationService</span> <span class="pl-kos">}</span>            <span class="pl-k">from</span> <span class="pl-s">'./model/navigation.service'</span><span class="pl-kos">;</span>

@<span class="pl-smi">Component</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">selector</span>: <span class="pl-s">'my-app'</span><span class="pl-kos">,</span>
    <span class="pl-c1">directives</span>: <span class="pl-kos">[</span><span class="pl-smi">RouterOutlet</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-c1">providers</span>: <span class="pl-kos">[</span><span class="pl-smi">NavigationService</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-c1">template</span>: <span class="pl-s">'&lt;router-outlet&gt;&lt;/router-outlet&gt;'</span><span class="pl-kos">,</span>
    <span class="pl-c1">precompile</span>: <span class="pl-kos">[</span> <span class="pl-smi">SelectorPageComponent</span> <span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">AppComponent</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">NavigationService imports @angular/router, as does AppComponent. Given the order of the imports in the ngfactory file, this seems to be the source of the issue.</p>
<p dir="auto">This may be related somehow to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="166041786" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/10132" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/10132/hovercard" href="https://github.com/angular/angular/issues/10132">#10132</a>, although ngc succeeds without any warnings so it's a different issue.</p>
<p dir="auto"><strong>Expected/desired behavior</strong></p>
<p dir="auto">Regardless of the cause, ngc should never import the exact same thing twice.</p>
<p dir="auto"><strong>Reproduction of the problem</strong></p>
<p dir="auto">I have not yet figured out how to reproduce this exact problem in a smaller project. Does anybody have insight as to what might cause this to happen? I am using @angular/compiler-cli (ngc) 0.4.1 and Angular 2.0.0-rc.4 with a fairly standard tsconfig.json file.</p>
<p dir="auto">One odd thing is that <code class="notranslate">"angularCompilerOptions": {"debug": true}</code> doesn't seem to do anything. I'd hoped it would shed insight on where imported files are coming from.</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.4</li>
<li><strong>Browser:</strong> all</li>
<li><strong>Language:</strong> TypeScript 1.8.2</li>
</ul>