-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bug: Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once. #19926
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
Comments
I'm seeing this in a new app I just created a few weeks ago. I have been doing Ionic / Stencil (no framework) for a couple years so I'm not sure if this is a new warning, something I'm doing wrong, etc. In a current Ionic 4 / Angular 8 application with two page components, each with a test suite, when run either individually there is no WARN. However, run them both together, and WARN is output for second test. |
I just upgraded my application to I didn't notice this warning message before but it's popping up now when I run |
These warnings are due to multiple calls to |
@Rajatsoni9 if only IonicModule is used it will not build up the Shadow DOM correctly. |
Since we currently can't prevent the warning, our workaround is to patch the console with a check for the specific warning message and mute it:
|
Thanks for the issue. This has been resolved via #23292, and a fix will be available in an upcoming release of Ionic Framework. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Bug Report
Ionic version:
[x] 4.x
Current behavior:
Create a new ionic angular app. Run the tests.
Expected behavior:
No warnings would be displayed.
This becomes more pervasive as the test suite grows. I see this warning numerous times throughout my real apps. Why is it there and how do we remove it? Is the generator setting up tests incorrectly?
Steps to reproduce:
git clone https://github.com/josh-m-sharpe/bareCapacitorApp.git
yarn install
npm run test
The text was updated successfully, but these errors were encountered: