Typecript error when buildin app with --prod

how to solve this problem.

i faced error like this and solved error by removing yourpage.mudule.ts file

this error means, as written in the error message, that your page is decared in 2 module.
Declaration is done with import statement of the file and then add it in ngmodule import array.
There are 3 different strategies to decare it.

  1. In app.module.ts. If you decare it here, then you use eager loading.
  2. In whatever.module.ts, where whatever in your case is af, then you use lazy loading.
  3. In a separete independ whatever.module.ts, which you can use with strategy 1 or 2.

In your case remove (comment out) in one of them your declaration in ngmodule import array. import {whatever} statement is not longer used.

If you want eager loading, then you can delete the to your file related whatever.module.ts, but if you comment it out, then you can switch easyly between eager and lazy loaded.

Best regards, anna-liebt