I am building Ionic 7.2.0/Angular/ngModule apps. Recently I found that once I use command line “Ionic g page page_name”, it always fails the compiling with the generated page with the following error message:
“error NG6008: Component PageName is standalone, and cannot be declared in an NgModule. Did you mean to import it instead?”
This issue was not there when I create new pages a few month earlier. I further investigated and found that I can add “standalone: false,” to @Component part in the page_name.page.ts file to fix the issue. However, it is very inconvenient to add such a statement for each new page I create. Is it possible to fix “Ionic generate” to avoid the error generated by default? Thanks!
You need to write your own Node.js script that watches for newly generated files and automatically adds standalone: false
to the component decorator.
If you’re using ngModule and not standalone components, you can try adding the --no-standalone flag when generating a page. That should prevent the need to manually edit each file.
Angular 19 updated the default components to standalone, so if you dont want to manually add all “standalone: false” to the components you can just downgrade to v18 of angular, until Ionic finds a way to solve this issue
Hope this helps in some way 
Te escribo en español porque todavía no se me da bien el inglés hehe, acabas de salvarme la vida, no tenía idea de por qué se estaba generando ese error, pero ya con lo del standalone:false solucione el tema, muchas gracias.