Closed bisho012 closed 7 years ago
I too am experiencing this problem.
We are using 1.5.0 for the CLI on Windows 10 x64
Subscribing. I've encountered the same issue with ng build --prod
, but not on ng serve
. See this thread, too: https://github.com/angular/angular/issues/13590
i have resolved this issue by removing multiple component classes with the same name.
I have fixed it just by matching the import statement with casing on the file name.
File name: communityInformation.component.ts
Thx. I had the same problem with also was caused by file casing
I had to remove a duplicate component class that wasn't declared in @NgModule. The fact that it wasn't imported and declared in the ngModule allowed ng serve to work.
My component was not in app.module.ts
declarations. (Thought it would be excluded though.)
I don't have multiple class with the same name and casing also is fine but still, I am getting this error.
I had the same error caused by a pipe that I forgot to declare
in a module. In dev it works fine without declaring. This wasn't happening in Angular 6, but happens in 7
My component was not in
app.module.ts
declarations. (Thought it would be excluded though.)
this fixed it for me as well. The component was not included in the app.module.ts file imports
I also having the same error: ERROR in : Cannot determine the module for class CCURLActionComponent in C:/Users/HP/Desktop/default-2/default/src/app/content/pages/header/action/aslaAction/aslaActionURL/asla-url-action.component.ts! Add CCURLActionComponent to the NgModule to fix it.
how to solve this error.
I also resolved this by fixing casing in an import statement. However, in my case the casing error was not in the app.module.ts file, but in one of the guards. So be sure to check the import casing in ALL the ts files in the project!
I fixed this error by moving some export interface IModel.....
from a component file to a dedicated file for models.
It appears like the compiler/trans-piler saw the component as not being declared in any NgModule, even though the component was not used.
My project structure is multiple projects, and it was only causing the failure in the projects that were not using the component in question.
I also having the same error: ERROR in : Cannot determine the module for class CCURLActionComponent in C:/Users/HP/Desktop/default-2/default/src/app/content/pages/header/action/aslaAction/aslaActionURL/asla-url-action.component.ts! Add CCURLActionComponent to the NgModule to fix it.
how to solve this error.
I have the same error but I don't have any duplicate's and using the same file naming convention everywhere. I am lazy loading my components so they are not in the app.module.
everywhere I do the same thing but at this specific component, it doesn't work.
when I get rid of the link in the module it creates the same error twice.
I had the same error because I changed the folder name (upper case) to (lower case). It was working fine with ng serve and ng build but give error when I tried to build for production. I change the folder name in import statement on module file and it fixed the issue for me.
I had the same problem, Folder name casing was the reason for this .
solved this issue by removing a duplicate of same component
I have the same issue with an Abstract component.
I still have this issue. I created another project and add only the components which giving this error and guess what?! Still same issue.
I even switched the components name to A,B, C and D, still same issue. Why always angular build in production mode it's painful? Every time when I add an new component it's same issue and after some time I try build with prod randomly and works. What's the problem with angular?
User has added CategoriesComponent in two place means two different file have same registration in module. First search and delete one place entry and rebuild again for pointing to prod
Error : Cannot determine the module for class CategoriesComponent in C:/project/src/app/Components/categories/categories.component.ts! Add CategoriesComponent to the NgModule to fix it.
100% working for me
One more possibility: My issue was I renamed a folder lowercase to match the paths. For reasons beyond my expertise, the folder "appeared" to be lowercase, but with a fresh clone of the git repository, that folder rename never was applied other than visually on my system.
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.
I am not on the production phase on my web ... the project is working good ... I used
and it is working great .... then I tried :-
this error appeared
I know that I made a mistake ... I made 2 components with the same name but I removed the wrong one.
and here is the code of app.Module.ts file :-
I removed the component that was wrong and left the right one. What shall I do to make the production accept these components !
any suggestions ?