phoboslab / Ejecta

A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS
2.81k stars 322 forks source link

EXC_BAD_ACCESS Error (on iOS) when using Stream #665

Open pranshuagrawal opened 6 years ago

pranshuagrawal commented 6 years ago

I am using stream in my weex project, the apps crash everytime I try to run it on iOS simulator. It works fine on android though.

If I comment out the stream code (viz commenting the code where I am using stream and import is still uncommented) the application works fine on both the platform.

Considering that stream code is working fine on android concludes that there is nothing wrong with my Vue code (maybe I am not doing some iOS specific thingy).

Here is the code:

       stream.fetch({
            method: 'GET',
            type: 'json',
            url: 'https://example.com/someUrl.json'
        }, res => {
            if(res.ok){
                this.isLoading = false;
                this.isError = false;

                this.number = res.data.number;
                this.name = res.data.name;
            }else{
                this.isLoading = false;
                this.isError = true;
            }      
        });

The error which I get is on the following line:

        callbackRsp setObject:@{ @"OPENED": @1 } forKey:@"readyState"];
        progressCallback(callbackRsp, TRUE);

The error is:

        Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)

Occuring on progressCallback line.

What I can think of is that it could be because of some package which I need to install or maybe version number of something is messed up because on playground it is working absolutely fine.

Any help would greatly appreciated.

ghost commented 6 years ago

Ejecta supports XmlHttpRequest out of the box. Have you tried that?