Skip to content

bug: Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once. #19926

@josh-m-sharpe

Description

@josh-m-sharpe

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

> bareCapacitorApp@0.0.1 test /Users/jsharpe/bareCapacitorApp
> ng test

 10% building 1/1 modules 0 active16 11 2019 06:46:05.349:WARN [karma]: No captured browser, open http://localhost:9876/
16 11 2019 06:46:05.420:INFO [karma-server]: Karma v4.1.0 server started at http://0.0.0.0:9876/
16 11 2019 06:46:05.420:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
16 11 2019 06:46:05.426:INFO [launcher]: Starting browser Chrome
16 11 2019 06:46:13.256:WARN [karma]: No captured browser, open http://localhost:9876/
16 11 2019 06:46:13.490:INFO [Chrome 78.0.3904 (Mac OS X 10.14.6)]: Connected on socket YbYWbp2Wnno-nsT5AAAA with id 37625611
Chrome 78.0.3904 (Mac OS X 10.14.6): Executed 0 of 6 SUCCESS (0 secs / 0 secs)
16 11 2019 06:46:16.551:WARN [web-server]: 404: /svg/md-book.svg
16 11 2019 06:46:16.553:WARN [web-server]: 404: /svg/md-build.svg
16 11 2019 06:46:16.555:WARN [web-server]: 404: /svg/md-grid.svg
WARN: 'Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once.'
Chrome 78.0.3904 (Mac OS X 10.14.6): Executed 1 of 6 SUCCESS (0 secs / 0.465 secs)
WARN: 'Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once.'
Chrome 78.0.3904 (Mac OS X 10.14.6): Executed 2 of 6 SUCCESS (0 secs / 0.698 secs)
Chrome 78.0.3904 (Mac OS X 10.14.6): Executed 4 of 6 SUCCESS (0 secs / 0.954 secs)
16 11 2019 06:46:17.093:WARN [web-server]: 404: /svg/md-flash.svg
16 11 2019 06:46:17.096:WARN [web-server]: 404: /svg/md-apps.svg
Chrome 78.0.3904 (Mac OS X 10.14.6): Executed 6 of 6 SUCCESS (1.07 secs / 0.995 secs)
TOTAL: 6 SUCCESS
TOTAL: 6 SUCCESS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions