Ionic-framework: Errors not shown on Mac OSX -> blank/white screen in iOS or the app fails silently

Created on 4 May 2016  路  12Comments  路  Source: ionic-team/ionic-framework

Short description of the problem:

When there's an error in the code _(JavaScript/TypeScript/HTML)_ it is not displayed in the console.

What behavior are you expecting?

A error should be displayed in the console to indicate that something is wrong with details about the cause.

Steps to reproduce:

  1. Make sure to test on Mac OS X El Capitan.
  2. Start a new project: ionic start TestAppJS blank --v2.
  3. Replace the content of home.js with the code below.
  4. Run ionic serve.
  5. Observe that no error is shown in the console.
// NOTE: Intentionally not importing Storage so that an exception is thrown.
import {Page, NavController, SqlStorage} from 'ionic-angular';

@Page({
  templateUrl: 'build/pages/home/home.html'
})
export class HomePage {
  static get parameters() {
    return [[NavController]];
  }
  constructor(nav) {
    this.db = new Storage(SqlStorage);
  }
}

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Which Ionic Version? 2.x

Plunker that shows an example of your issue

Not reproducible in Plunker - seems to be a platform-specific issue _(Mac OS X)_

Run ionic info from terminal/cmd prompt: (paste output below)

NOTE: The info below is summarized across all reports and related issues.

Cordova CLI: 6.1.1 / Not installed
Ionic Framework Version: 2.0.0-beta.4 / beta.5 / beta.6
Ionic CLI Version: 2.0.0-beta.17 / beta.24 / beta.25
Ionic App Lib Version: 2.0.0-beta.8 / beta.14 / beta.15
OS: Mac OS X El Capitan (all of them)
Node Version: v4.2.2 / v4.4.3 / v5.1.1 / v5.8.0 / v5.10.1
Xcode version: Xcode 7.2 / 7.3 / Not installed

Most helpful comment

@epetre You shouldn't have import 'es6-shim'; in app.js. It will also break the change detection if you add it in there. Check out the following guide to make sure that you updated to beta.6 correctly.

All 12 comments

This is an extension of the discussion on #6217. Hey @iignatov ! I cant seem to reproduce this on osx El Capitan with the latest chrome canary or firefox.

@jgw96 After some research I guess that it might be reproducible only in a WebKit-browsers, e.g. Safari.

@iignatov Im wondering if this might have something to do with the dev tools in safari not supporting promise inspection. Will have to do some testing today. Thanks for all the info!

@jgw96 I believe that it's actually a feature of Chrome _(and maybe Firefox)_ to log the unhandled errors in Promises. This would explain why the behavior is not reproducible in Chrome/Firefox on any OS. I guess that WebKit/Safari sticks to the default/expected behavior and just swallows the unhandled errors.

Not sure if it's related, but I had a in import 'es6-shim'; in app.js it caused alot of errors to get swallowed.

@epetre Were you using chrome to test or safari?

I was on Chrome and OSX, yes. If I add import 'es6-shim', it swallows the error. When I remove it, shows me the trace directly in the browser console.

@epetre You shouldn't have import 'es6-shim'; in app.js. It will also break the change detection if you add it in there. Check out the following guide to make sure that you updated to beta.6 correctly.

@epetre @iignatov is correct, sorry i should have mentioned that earlier.

Also, @iignatov , so i just did some testing with safari, and errors are showing up fine for me. So it seems that, unfortunately, i cant reproduce this issue with any browser.

@jgw96 Ok, great, I guess that the bug was fixed in beta.6 then. Most probably the people that are still experiencing issues with beta.6 haven't performed the update correctly. Let's close the issue for now.

@jgw96 that's what I think too, in my case at least.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MrBokeh picture MrBokeh  路  3Comments

giammaleoni picture giammaleoni  路  3Comments

fdnhkj picture fdnhkj  路  3Comments

brandyscarney picture brandyscarney  路  3Comments

vswarte picture vswarte  路  3Comments