You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
alasql undefined under ionic / iOS (Phonegap, cordova) #410
alasql works fine in android, chrome, IE, FF, Safari, and even on Safari within iOS. But as an iOS app, alasql fails to load. Maybe a problem with webworkers? I also noticed the "alasql"-defintion around Line 90 in alsql.js gets called over a 100 times! Is this normal?
// (...) Around line 89/90
var alasql = function alasql(sql, params, cb, scope) {
console.log("alasql defined!");
Simple check for iOS regarding the alasql not found error:
var check = 0;
var checkAlasql = function(id) {
check++;
console.log("checking alasql: Try "+check);
if(typeof alasql !== 'undefined'){
console.log("alasql was DEFINED");
} else {
console.log("alasql was UNDEFINED");
setTimeout(function(id){
checkAlasql(id);
},100);
}
};
checkAlasql(10);
With the current develop version it is not working either. alasql is UNDEFINED.
If including alasql-worker.min.js then it seems alasql is defined. But it seems we are running into other problems there. And it should work as well without having to include alasql-worker.min.js.
Activity
mathiasrw commentedon Sep 14, 2015
Thank you for investigating.
What version of the library are you using? Could I ask you to try the latest version from the develop branch ( https://github.com/agershun/alasql/tree/develop/dist ) and verify if the problem pesists? We have had some issues with the UMD wrapping of the code.
Does iOS phonegap apps run javascript as a webworker? (sorry, I dont have much experience with phonegap)
pboos commentedon Sep 14, 2015
With the current develop version it is not working either. alasql is UNDEFINED.
If including alasql-worker.min.js then it seems alasql is defined. But it seems we are running into other problems there. And it should work as well without having to include alasql-worker.min.js.
Any idea what it could be?
pboos commentedon Sep 14, 2015
Found the problem!!!
Problem is this line:
it should be
Because on iOS it seems to crash because window.indexedDB = undefined
pboos commentedon Sep 14, 2015
Strange. There seems to be a check above that line that i missed.
But seems like this check is not correct?
pboos commentedon Sep 14, 2015
Continued research.
Seems like that line is not working correctly on iOS.
I checked the following in the iOS app:
Seems like window.indexedDB = null.
And null seems to be of type object.
So that check is not correct on iOS...
I will send a pull request which changes
to
which does the check correct
mathiasrw commentedon Sep 14, 2015
You are a hero!
I'll add it as soon as I get to a computer
mathiasrw commentedon Sep 15, 2015
Hey @pboos
So glad you took the time to dig into the issue!
We really need to get the change from https://github.com/pboos/alasql/commit/656792d46c0050e5cdd51e5361904915b64017b6 into the develop branch and not the master branch
I could just copy the single line changed into develop - but then you would not be credited with the edits.
Please provide a new pull request to the develop branch or let me know if I should just put it into the develop branch.