ionicBootstrap sometimes hangs, then the app crashes without bootstrapping [iOS]

I began troubleshooting it and discovered that in the case where the app does not bootstrap, cssReady never seems to call done(). Although it doesn’t seem to increment the cssLoadAttempt indefinitely either.

Ionic team – any ideas as to why my app occasionally goes into a death spiral on ionicBootstrap() but most of the time not?

Would having the ionicBootstrap call inside a ‘deviceready’ event callback cause a problem? I’ve done that so that I can clear some localStorage prior to bootstrapping the app if necessary.

I’m at a loss here.

I should point out that my ionicBootstrap works fine in desktop browser testing, it’s on iOS that it’s hit or miss.

Can you share some code of what you’re doing?

Normally, you should not being using device ready to bootstrap things, as ionicbootstrap takes care of everything automatically.

Yeah, here’s gist of my App and boot code. There’s a lot there, but but you can see around line 234 where things begin.

https://gist.github.com/jasonwaters/b956f5b28466ff198e8985e8ba5451a3

The problem is exacerbated on older (slower) devices like iphone 5 and 6. I am using a lot of things in the app like ngrx, rxjs, and localStorage. The reason I want to handle deviceready before app load is due to the nature of how localStorage is rehydrated at ionicBoot. I want to clear some state before hand if needed.

I’m desperate for ideas here, thanks for looking.

Holy app.ts batman!

Hmm, there’s so much going on here, it’s hard to know where to even begin. Maybe you could provide a more isolated demo?

I think it may be plugin related? Is it possible some plugin is not allowing deviceready to be called in a timely manner on ios?

I solved my own problem. It was due to a bug in cordova-ios. I wrote about it in this thread: