1

I have an application whose development is complete. Now when I run the command ng build everything works smooth & fine. But when I run this command

ng build --prod --base-href /Incrency/

It shows the login page but when I login in it throws the following error.

ERROR Error: Uncaught (in promise): Error: No component factory found for t. 
Did you add it to @NgModule.entryComponents?
Error: No component factory found for t. Did you add it to @NgModule.entryComponents?

I am using Angular CLI : 7.3.2, Rxjs : 6.3.3 & Angular Core : 7.0.6

2 Answers 2

3

I have also faced the same issue, after trying all the steps on internet i finally figured out by removing the directive reference in html file which actually deleted, above error will not appear in ng build but if you try ng build --prod flag it will apear, so try checking directive actually exists before using it in Html, Hope this will solve your issue.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Man. You are such a Life Saver. I was stucked from past 2 days on this. just because on of my colleague used that directive in his html & deleted directive. Thanks once again. Happy Coding :)
1

Issue might be, some components is getting used in your application which is not declared in NgModule. It should be added as the entryComponents, otherwise angular can't able to identify and compile it during build time.

7 Comments

OK but what how do i will come to know the component name as it is telling No component factory found for t ? What does t stands for here ?
Might be check common module. we need to manually analyze and fix it.
Any other alternative ?
If angular cannot report it, check stacktrace-js npm package able to find it.
I am using Lazy Loding so do i need to add to app module or that component's parent module ?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.