<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>
getting lots of errors from unused components:</p>
<p dir="auto"><strong>Expected behavior</strong><br>
if I don't declare a component in my declarations, i18 should not look at it</p>
<p dir="auto">I run the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./node_modules/.bin/ng-xi18n
Error: Cannot determine the module for class DividerPanel in C:/msweb/ng-skeleton/src/comps/dividerpanel/DividerPanel.ts!
Cannot determine the module for class Dropbox in C:/msweb/ng-skeleton/src/comps/dropbox/Dropbox.ts!
Cannot determine the module for class EntryPanel in C:/msweb/ng-skeleton/src/comps/entry/EntryPanel.ts!
Cannot determine the module for class ForgotPass in C:/msweb/ng-skeleton/src/comps/entry/ForgotPass.ts!
Cannot determine the module for class Footer in C:/msweb/ng-skeleton/src/comps/footer/Footer.ts!
Cannot determine the module for class Infobox in C:/msweb/ng-skeleton/src/comps/infobox/Infobox.ts!
Cannot determine the module for class InputNumeric in C:/msweb/ng-skeleton/src/comps/inputnumeric/InputNumeric.ts!
Cannot determine the module for class InputString in C:/msweb/ng-skeleton/src/comps/inputstring/InputString.ts!
Cannot determine the module for class Loading in C:/msweb/ng-skeleton/src/comps/loading/Loading.ts!
Cannot determine the module for class MapAddress in C:/msweb/ng-skeleton/src/comps/mapaddress/MapAddress.ts!
Cannot determine the module for class Minitab in C:/msweb/ng-skeleton/src/comps/minitabs/MiniTab.ts!
Cannot determine the module for class Minitabs in C:/msweb/ng-skeleton/src/comps/minitabs/MiniTabs.ts!
Cannot determine the module for class ModalDialog in C:/msweb/ng-skeleton/src/comps/modaldialog/ModalDialog.ts!
Cannot determine the module for class Ng2Highcharts in C:/msweb/ng-skeleton/src/comps/ng2-highcharts/src/directives/ng2-highcharts.ts!

Cannot determine the module for class Ng2Highstocks in C:/msweb/ng-skeleton/src/comps/ng2-highcharts/src/directives/ng2-highstocks.ts!

Cannot determine the module for class Ng2Highmaps in C:/msweb/ng-skeleton/src/comps/ng2-highcharts/src/directives/ng2-highmaps.ts!
Cannot determine the module for class simplelistEditable in C:/msweb/ng-skeleton/src/comps/simplelist/simplelistEditable.ts!
Cannot determine the module for class simplelist in C:/msweb/ng-skeleton/src/comps/simplelist/simplelist.ts!
Cannot determine the module for class FilterPipe in C:/msweb/ng-skeleton/src/pipes/FilterPipe.ts!
Cannot determine the module for class FilterPipeEqual in C:/msweb/ng-skeleton/src/pipes/FilterPipeNot.ts!
Cannot determine the module for class OrderBy in C:/msweb/ng-skeleton/src/pipes/OrderBy.ts!
Cannot determine the module for class ReplacePipe in C:/msweb/ng-skeleton/src/pipes/ReplacePipe.ts!
Cannot determine the module for class SortBy in C:/msweb/ng-skeleton/src/pipes/SortBy.ts!
    at analyzeAndValidateNgModules (C:\msweb\ng-skeleton\node_modules\@angular\compiler\bundles\compiler.umd.js:24878:17)
    at Extractor.extract (C:\msweb\ng-skeleton\node_modules\@angular\compiler\bundles\compiler.umd.js:27727:20)
    at Extractor.extractBundle (C:\msweb\ng-skeleton\node_modules\@angular\compiler-cli\src\extractor.js:40:33)
    at Extractor.extract (C:\msweb\ng-skeleton\node_modules\@angular\compiler-cli\src\extractor.js:30:34)
    at extract (C:\msweb\ng-skeleton\node_modules\@angular\compiler-cli\src\extract_i18n.js:7:67)
    at Object.main (C:\msweb\ng-skeleton\node_modules\@angular\tsc-wrapped\src\main.js:47:16)
    at Object.&lt;anonymous&gt; (C:\msweb\ng-skeleton\node_modules\@angular\compiler-cli\src\extract_i18n.js:14:9)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
Extraction failed"><pre class="notranslate"><code class="notranslate">$ ./node_modules/.bin/ng-xi18n
Error: Cannot determine the module for class DividerPanel in C:/msweb/ng-skeleton/src/comps/dividerpanel/DividerPanel.ts!
Cannot determine the module for class Dropbox in C:/msweb/ng-skeleton/src/comps/dropbox/Dropbox.ts!
Cannot determine the module for class EntryPanel in C:/msweb/ng-skeleton/src/comps/entry/EntryPanel.ts!
Cannot determine the module for class ForgotPass in C:/msweb/ng-skeleton/src/comps/entry/ForgotPass.ts!
Cannot determine the module for class Footer in C:/msweb/ng-skeleton/src/comps/footer/Footer.ts!
Cannot determine the module for class Infobox in C:/msweb/ng-skeleton/src/comps/infobox/Infobox.ts!
Cannot determine the module for class InputNumeric in C:/msweb/ng-skeleton/src/comps/inputnumeric/InputNumeric.ts!
Cannot determine the module for class InputString in C:/msweb/ng-skeleton/src/comps/inputstring/InputString.ts!
Cannot determine the module for class Loading in C:/msweb/ng-skeleton/src/comps/loading/Loading.ts!
Cannot determine the module for class MapAddress in C:/msweb/ng-skeleton/src/comps/mapaddress/MapAddress.ts!
Cannot determine the module for class Minitab in C:/msweb/ng-skeleton/src/comps/minitabs/MiniTab.ts!
Cannot determine the module for class Minitabs in C:/msweb/ng-skeleton/src/comps/minitabs/MiniTabs.ts!
Cannot determine the module for class ModalDialog in C:/msweb/ng-skeleton/src/comps/modaldialog/ModalDialog.ts!
Cannot determine the module for class Ng2Highcharts in C:/msweb/ng-skeleton/src/comps/ng2-highcharts/src/directives/ng2-highcharts.ts!

Cannot determine the module for class Ng2Highstocks in C:/msweb/ng-skeleton/src/comps/ng2-highcharts/src/directives/ng2-highstocks.ts!

Cannot determine the module for class Ng2Highmaps in C:/msweb/ng-skeleton/src/comps/ng2-highcharts/src/directives/ng2-highmaps.ts!
Cannot determine the module for class simplelistEditable in C:/msweb/ng-skeleton/src/comps/simplelist/simplelistEditable.ts!
Cannot determine the module for class simplelist in C:/msweb/ng-skeleton/src/comps/simplelist/simplelist.ts!
Cannot determine the module for class FilterPipe in C:/msweb/ng-skeleton/src/pipes/FilterPipe.ts!
Cannot determine the module for class FilterPipeEqual in C:/msweb/ng-skeleton/src/pipes/FilterPipeNot.ts!
Cannot determine the module for class OrderBy in C:/msweb/ng-skeleton/src/pipes/OrderBy.ts!
Cannot determine the module for class ReplacePipe in C:/msweb/ng-skeleton/src/pipes/ReplacePipe.ts!
Cannot determine the module for class SortBy in C:/msweb/ng-skeleton/src/pipes/SortBy.ts!
    at analyzeAndValidateNgModules (C:\msweb\ng-skeleton\node_modules\@angular\compiler\bundles\compiler.umd.js:24878:17)
    at Extractor.extract (C:\msweb\ng-skeleton\node_modules\@angular\compiler\bundles\compiler.umd.js:27727:20)
    at Extractor.extractBundle (C:\msweb\ng-skeleton\node_modules\@angular\compiler-cli\src\extractor.js:40:33)
    at Extractor.extract (C:\msweb\ng-skeleton\node_modules\@angular\compiler-cli\src\extractor.js:30:34)
    at extract (C:\msweb\ng-skeleton\node_modules\@angular\compiler-cli\src\extract_i18n.js:7:67)
    at Object.main (C:\msweb\ng-skeleton\node_modules\@angular\tsc-wrapped\src\main.js:47:16)
    at Object.&lt;anonymous&gt; (C:\msweb\ng-skeleton\node_modules\@angular\compiler-cli\src\extract_i18n.js:14:9)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
Extraction failed
</code></pre></div>
<p dir="auto">versions:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="angular-cli: 1.0.0-beta.25.5
node: 6.5.0
os: win32 x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/compiler-cli: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/platform-server: 2.4.3
@angular/router: 3.2.1
@angular/language-service: 2.4.3
"><pre class="notranslate"><code class="notranslate">angular-cli: 1.0.0-beta.25.5
node: 6.5.0
os: win32 x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/compiler-cli: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/platform-server: 2.4.3
@angular/router: 3.2.1
@angular/language-service: 2.4.3

</code></pre></div>
<p dir="auto">Angular 2 Kitchen sink: <a href="http://ng2.javascriptninja.io" rel="nofollow">http://ng2.javascriptninja.io</a><br>
and source@ <a href="https://github.com/born2net/Angular-kitchen-sink">https://github.com/born2net/Angular-kitchen-sink</a><br>
Regards,</p>
<p dir="auto">Sean</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>
Unused components/pipes/directives in my workspace are detected by the compiler, which throws the error <code class="notranslate">Cannot determine the module for class (...)</code> for each file. It stops compilation, and does not seem be configurable. This is a problem, since I need to have those files in my workspace, but do not need them in the resultant app (partner implementations requiring different combos of shared components). This is especially frustrating with regards to compiling in a webpack loader, which should be able to provide a list of files which are included, regardless of workspace.</p>
<p dir="auto"><strong>Expected behavior</strong><br>
I would expect these errors to be warnings, and/or able to be silenced by a compiler option. Alternatively, with regards to webpack, you could allow a list of files to be inserted, so that a webpack could provide all files in the require chain, instead of all files in the workspace.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br>
Cannot demo in plunkr, since it uses JIT.</p>
<ol dir="auto">
<li>Create a basic angular app which bootstraps an ngModule with one component, AppComponent</li>
<li>Get this app into a state which can be AOT compiled (should be pretty easy with a hello world)</li>
<li>Add a component to the directory structure, but do not reference it anywhere in your code.</li>
<li>Try to AOT compile again. You will get the warning <code class="notranslate">Cannot determine the module for class</code></li>
</ol>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
My company has a base app for ourselves, and our partners use modified versions of that app as their own. Rather than maintain all partners separately, we use a shared library of common generic components, imported as needed. For our base app, everything is fine, since we use every component. For partners, we cannot use AOT, since some of the components in the shared npm package do not have a declared module.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
Happens across all devices, but the current testing setup is:<br>
WIndows 10<br>
VS Code<br>
Cmder (bash terminal)</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong><br>
v2.1.0 (though we have also tested in 2.3.1</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> All - this is a compiler issue, not browser specific</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> Typescript</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> node v6.3.0</p>
</li>
</ul>