My website functions perfectly on Chrome for desktop (Windows 8.1 & OS X Mavericks). However, when I try to run it on iOS 7 or Safari 7.0.2, an error is displayed in the console that says:
Error while loading route: checkIfLoggedIn
The message specifies that the member is not a route, but rather a method that returns a promise. Upon debugging through the ember code, I discovered that the promise is being rejected with the reason:
Can't find variable: Promise
I am unable to share the actual code from my site here, so I attempted to create a fiddle to replicate the error. Here is the link to the fiddle:
http://jsfiddle.net/NQKvy/851/
This fiddle works fine on Chrome for Windows 8.1 and OS X Mavericks. However, on iOS 7 or Safari 7.0.2, it throws this error to the console:
ReferenceError: Can't find variable: Promise
Does anyone have any suggestions as to why this issue is occurring?
In summary:
- Tested on Chrome for Windows 8.1 and OS X Mavericks - Works
- Tested on Chrome for iOS - Does not work
- Tested on Safari for iOS and OS X Mavericks - Does not work
- Have not tested on Android yet
Based on my observations, I suspect it may be a Safari-related problem, considering that Chrome for iOS uses a Safari control to render pages instead of Chromium.
Here is the snippet of code causing the error:
App.ready = function() {
var asdf = new Promise(function (resolve) {
var i = 1;
i++;
resolve.call(this,i);
}).then(function (result) {
alert('I: ' + result);
});
};