Upgrade to 3.7.1 now iOS 9.3.5 doesn't fire ready callback

I’m upgrading from Ionic 3.4.2 to 3.7.1 and now my iPad (iOS v 9.3.5) never fires platform ready (and doesn’t bring down the splash screen).

When I run ionic cordova run ios --device -l -c I also can’t connect Safari remote debugger and the only console output is:

[09:50:30]  console.log: deviceready has not fired after 5 seconds. 
[09:50:30]  console.log: Channel not fired: onPluginsReady 
[09:50:30]  console.log: Channel not fired: onCordovaReady 
[09:50:30]  console.log: Channel not fired: onDOMContentLoaded

But when I run against my iPhone (iOS v10.3.3) the splash screen is closed and the console output is:

[09:48:02]  console.log: deviceready has not fired after 5 seconds. 
[09:48:02]  console.log: Channel not fired: onDOMContentLoaded 
[09:48:28]  console.log: STATUS: initializing 
[09:48:29]  console.log: Angular is running in the development mode. Call enableProdMode() to enable the production 
            mode. 
[09:48:29]  console.warn: Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an 
            inconsistent state. Try removing plugins from plugins/ and reinstalling them. 
[09:48:29]  console.log: Ionic Native: deviceready event fired after 17987 ms 

Has anyone experienced this? Any ideas?

2 Likes

I found the problem it’s due to version 3.0.0 of @ionic/app-scripts. My app imports and uses an npm module - here’s a simplified example:

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import * as FileType from 'file-type';


@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController) {
    console.log(JSON.stringify(FileType));
  }

}

When ionic cordova run ios --prod using 3.0.0 app-scripts the app will launch and leave the splash screen up. If I change to version 2.1.4 of app-scripts the app launches and runs correctly.

OK the real problem was the file-type package is in ES6 so it’s being pulled in without transpilation to ES5. Probably browsers in newer devices could handle the ES6 JS natively. Changed to the file-type-es5 package and all is well on older devices.