White screen when running cutePuppyPics


#1

I am an Ionic newbie wanting to use the Ionic 2 beta.
I followed the instructions at http://ionicframework.com/docs/v2/getting-started/installation/.
Ionic serve works fine.
When running cutePuppyPics on Genymotion, I get only a white screen, and the error in the console is:

0 252401 error Uncaught TypeError: Cannot call method ‘bind’ of undefined, http://192.168.0.11:8100/build/js/app.bundle.js, Line: 61524

My system info:
Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.5-201604211454
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Windows 7 SP1
Node Version: v5.4.0

Any idea what I am doing wrong?


#2

Same issue for me with MyIonic2Project, the second app in the tutorial.
Error in console is:
0 103291 error Uncaught TypeError: Cannot call method ‘bind’ of undefined, http://192.168.0.11:8100/build/js/app.bundle.js, Line: 61561

Here’s the code around that line, with the line itself pointed out with asterisks:

// RequestAnimationFrame Polyfill (Android 4.3 and below)
/*! @author Paul Irish */
/*! @source https://gist.github.com/paulirish/1579671 */
(function () {
    var rafLastTime = 0;
    var win = window;
    if (!win.requestAnimationFrame) {
        win.requestAnimationFrame = function (callback, element) {
            var currTime = Date.now();
            var timeToCall = Math.max(0, 16 - (currTime - rafLastTime));
            var id = window.setTimeout(function () {
                callback(currTime + timeToCall);
            }, timeToCall);
            rafLastTime = currTime + timeToCall;
            return id;
        };
    }
    if (!win.cancelAnimationFrame) {
        win.cancelAnimationFrame = function (id) { clearTimeout(id); };
    }
})();
// use native raf rather than the zone wrapped one
// ********************** the following line throws the error
exports.raf = (window[window['Zone']['__symbol__']('requestAnimationFrame')] || window[window['Zone']['__symbol__']('webkitRequestAnimationFrame')])['bind'](window);
exports.cancelRaf = window.cancelAnimationFrame.bind(window);
exports.nativeTimeout = window[window['Zone']['__symbol__']('setTimeout')]['bind'](window);
exports.clearNativeTimeout = window[window['Zone']['__symbol__']('clearTimeout')]['bind'](window);
function rafFrames(framesToWait, callback) {
    framesToWait = Math.ceil(framesToWait);
    if (framesToWait < 2) {
        exports.raf(callback);
    }
    else {
        exports.nativeTimeout(function () {
            exports.raf(callback);
        }, (framesToWait - 1) * 16.6667);
    }
}
exports.rafFrames = rafFrames;
exports.CSS = {};

Ionic 2 APP won't run in earlier than Android 5.0?
#4

Matt, you might want to try grabbing Ionic 2.0.0-beta.5, as it fixed a problem for me with a compile error that was occurring. It did not fix the particular issue I posted about in this topic, however.