-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Multiple instances of certain services created on bootstrap (App) #6685
Comments
We just refactored Ionic so it no longer uses @jgw96 Would you be able to test this out and see if you can replicate the issue with the updated |
@adamdbradley Yep, sure can. Will post my results here. |
Thanks for your help! 👍 |
Hello @btroncone ! I cant seem to reproduce this with our latest nightly that has the updates Adam described above. Would you be able to install Ionic 2 nightly and see if you can reproduce? If so, to install the latest Ionic 2 nightly you can simply run
As you will notice any configs that you have must also be moved to this ionicBootstrap call. If none of this makes sense just comment on here and i will help! |
I am attempting the upgrade now in order to test and am receiving this error: Now that the Thanks in advance! Edit: If there is a sample project I could look at with new setup that may be ideal. |
Hey @btroncone sorry you are having trouble upgrading! Here is an example repo i made of how to upgrade, hopefully it helps. |
@jgw96 It works fine until I add providers to the Working: ionicBootstrap(MyApp, []); Fails: ionicBootstrap(MyApp, [
provideStore(reducer)
]); After checking with multiple services it seems to fail at the first Error message: |
@btroncone Ahh ok, so after discussing this with the team this is actually a known issue and were actually working on this as we speak. I was obviously testing wrong above, sorry about that! |
I will update this issue when this is fixed. |
Thanks! 👍 |
Hey @btroncone so the awesome @brandyscarney just cut another nightly with a fix for the above discussed issue. You can install |
I am also going to do some testing again |
Awesome, thanks! I'll test again in morning 👍 |
@btroncone Sounds good! |
I just tested it. Seems good to me! 👍 |
Sorry for delay, a few other devs and I also tested and all seems good. Awesome work! 👍 |
Thanks for letting us know! This will be in the |
Short description of the problem:
In certain cases Ionic is creating multiple instances of a service included as a provider in the
@App()
decorator. I have attached a link to a plunker displaying the issue. This same setup works fine with a vanilla Angular 2 application, with one instance of the service created. This can be seen here. I have spoken to other developers experiencing the same problem but have yet to track down the root cause.Thanks in advance for your help!
What behavior are you expecting?
One instance of each service included in providers for
App
decorator.Steps to reproduce: (Instructions also in Plunk)
Which Ionic Version? 1.x or 2.x
2.x
Plunker that shows an example of your issue
http://plnkr.co/edit/gSrdJrFfGwHEPBMWlERH?p=preview
The text was updated successfully, but these errors were encountered: