Error when "ionic build --prod" for pwa application

Hi, I always used the “ionic serve” command to test my pwa and it works fine. Now it is finished and I want some performance improvement, so I decided to use the build command.

I don’t use lazy loading and all pages are imported in app.module.ts (declarations and entryComponents).

But, the build --prod command raise the folowing error:

typescript error
Type DetailsPage in /home/claudio/workspace/pesqSaude/src/pages/details/details.ts is part of the
declarations of 2 modules: AppModule in /home/claudio/workspace/pesqSaude/src/app/app.module.ts and
DetailsPageModule in /home/claudio/workspace/pesqSaude/src/pages/details/details.module.ts! Please consider
moving DetailsPage in /home/claudio/workspace/pesqSaude/src/pages/details/details.ts to a higher module that
imports AppModule in /home/claudio/workspace/pesqSaude/src/app/app.module.ts and DetailsPageModule in
/home/claudio/workspace/pesqSaude/src/pages/details/details.module.ts. You can also create a new NgModule
that exports and includes DetailsPage in /home/claudio/workspace/pesqSaude/src/pages/details/details.ts then
import that NgModule in AppModule in /home/claudio/workspace/pesqSaude/src/app/app.module.ts and
DetailsPageModule in /home/claudio/workspace/pesqSaude/src/pages/details/details.module.ts.

I already saw that I have to delete pageName.module.ts files and @IonicPage() at .ts file, but doing this my app doesn’t works with “ionic serve” anymore.

What I can do to solve this problem?

This fixed the problem :