Issue 1:
[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

getting lots of errors from unused components:

Expected behavior

if I don't declare a component in my declarations, i18 should not look at it

I run the following:

$ ./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.<anonymous> (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

versions:

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

Angular 2 Kitchen sink: http://ng2.javascriptninja.io

and source@ https://github.com/born2net/Angular-kitchen-sink

Regards,

Sean

Issue 2:
[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Unused components/pipes/directives in my workspace are detected by the compiler, which throws the error Cannot determine the module for class (...) 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.

Expected behavior

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.

Minimal reproduction of the problem with instructions

Cannot demo in plunkr, since it uses JIT.

Create a basic angular app which bootstraps an ngModule with one component, AppComponent

Get this app into a state which can be AOT compiled (should be pretty easy with a hello world)

Add a component to the directory structure, but do not reference it anywhere in your code.

Try to AOT compile again. You will get the warning Cannot determine the module for class

What is the motivation / use case for changing the behavior?

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.

Please tell us about your environment:

Happens across all devices, but the current testing setup is:

WIndows 10

VS Code

Cmder (bash terminal)

Angular version:

v2.1.0 (though we have also tested in 2.3.1

Browser: All - this is a compiler issue, not browser specific

Language: Typescript

Node (for AoT issues): node v6.3.0