Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find an NgModule. Use the skip-import option to skip importing in NgModule. #5100

Open
rajinder-yadav opened this issue Dec 25, 2024 · 3 comments
Labels

Comments

@rajinder-yadav
Copy link

rajinder-yadav commented Dec 25, 2024

Description:

Seems like the CLI doesn't understand Angular 19 standalone conmponent. I am unable to create a page using:

FYI: Standalone component is now the default.

 ionic g page pages/home

Getting the following error

> ng generate page pages/home --project=app
Could not find an NgModule. Use the skip-import option to skip importing in NgModule.
[ERROR] Could not generate page.

My ionic info:

$ ionic info

Ionic:

   Ionic CLI                     : 7.2.0 (/home/yadav/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 8.4.1
   @angular-devkit/build-angular : 19.0.6
   @angular-devkit/schematics    : 19.0.0 (/home/yadav/.local/share/pnpm/global/5/.pnpm/@[email protected][email protected]/node_modules/@angular-devkit/schematics)
   @angular/cli                  : 19.0.6
   @ionic/angular-toolkit        : 12.1.1

Utility:

   cordova-res : not installed globally
   native-run  : 2.0.1

System:

   NodeJS : v22.11.0 (/home/yadav/.nvm/versions/node/v22.11.0/bin/node)
   npm    : 10.9.0
   OS     : Linux 6.12
@ionitron-bot ionitron-bot bot added the triage label Dec 25, 2024
@rajinder-yadav
Copy link
Author

This is also not supported

$ ionic g page pages/home --skip-import

> ng generate page pages/home --skip-import --project=app
Error: Unknown argument: skip-import

@rajinder-yadav
Copy link
Author

rajinder-yadav commented Dec 25, 2024

I am baffled using ionic CLI, why is it trying to use the project 'app' and then failing?

$ ionic g c pages/home
> ng generate component pages/home --project=app
Project "app" does not exist.

@rajinder-yadav
Copy link
Author

I forgot to mention, I added Ionic after generating an angular application using the Angular CLI.

Ionic was adding using the following step:

https://ionicframework.com/docs/intro/cdn#ionic--angular

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant