This error occurs in Angular when you have copied a module or component but you did not rename the class properly.

Solution

Make sure the components module file has the right "export class xModule" function inside xModule.ts.

second solution is that you possibly want to import a component inside another component. Make sure you import the module, rather than the component. So:

imports: [EventcardModule,

Instead of

imports: [EventcardComponent,