You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Angular compiler generates factories for components not found in a template or entry components #16984
[ 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
The component factory is generated for the component not used in a template and not added to the entry components list. See this screenshot
If a component isn't an entry component or wasn't found in a template, the compiler omits it.
Minimal reproduction of the problem with instructions
Go to the plunker and open Dev tools->Source tab->plunkerPreviewTarget->ng://->AppModule->AComp.ngfactory.js
I believe this is mainly focused at AOT since if you ran the same code in AOT you would get an error similar to Cannot determine the module for class AComp
Angular's jit compiler compiles all components that are mentioned in an NgModule, no matter if it is used or not. In that, it is similar to the AOT compiler.
This makes JIT compilation slower, but JIT is not intended for production use anyways, and doing it this way simplifies our internal code a lot.
Activity
Toxicable commentedon May 27, 2017
I believe this is mainly focused at AOT since if you ran the same code in AOT you would get an error similar to
Cannot determine the module for class ACompmaxkoretskyi commentedon May 27, 2017
@chuckjaz, if it's identified as a bug by a core team I'm willing to prepare a fix, but I'd need some guidance
tbosch commentedon May 30, 2017
Angular's jit compiler compiles all components that are mentioned in an
NgModule, no matter if it is used or not. In that, it is similar to the AOT compiler.This makes JIT compilation slower, but JIT is not intended for production use anyways, and doing it this way simplifies our internal code a lot.
tbosch commentedon May 30, 2017
so this works as expected.
maxkoretskyi commentedon May 31, 2017
@tbosch , so what's the use for
entryComponentsthen?And does it also mean that this phrase in the docs
is not correct?
angular-automatic-lock-bot commentedon Sep 11, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.