Closed neeravmehta closed 8 years ago
@neeravmehta
Can you tell me what environment ArrayBuffer
isn't defined in?
Our environment is a javascript/HTML5 mobile app, it uses an older version of webkit compiler.
I can add that check for ArrayBuffer to the SDK. I'm not sure that will be enough to fully resolve the issue you're seeing though. Have you tried adding that check and verified it works for your use case?
Just for reference, here's a list of the currently supported browsers: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/browser-intro.html
Thanks ! That would be great! Yeah I have it working with the ArrayBuffer check.In fact it is already being used with the check elsewhere in your codebase. How long does it take for this makes it to your sdk builder site? Although I am running into a networking error related to credentials, digging deeper to find out what is going on.
@neeravmehta I included the check with the just released v2.2.29 of the SDK. I'm going to close this issue, but feel free to open a new one if you find your networking issues are related to the SDK.
@chrisradek Hi, I checked it in latest version, the check still causes error. Probably javascript tries to think of it as a variable, that is not found. Here is the exact error I am getting "Can't find variable: ArrayBuffer"
Here is the check that fixed it for me
if (util.isBrowser() && typeof ArrayBuffer !== "undefined" && data && data.buffer instanceof ArrayBuffer) isBuffer = true;
instead of
if (util.isBrowser() && ArrayBuffer && data && data.buffer instanceof ArrayBuffer) isBuffer = true;
What is ArrayBuffer when you hit that line? Just checking for ArrayBuffer should return a falsey value if it is undefined, which is also what your check is doing.
Unfortunately I cannot debug our platform, so i cannot tell you the exact value for ArrayBuffer. But from what I understand it does not know what ArrayBuffer is, hence best guesses it to a variable , that is not defined and throws an error when it sees it being used. This thread helped me understand it
http://stackoverflow.com/questions/3390396/how-to-check-for-undefined-in-javascript
@neeravmehta Is the application running on Appcelerator?
@neeravmehta it looks like you may be using a version of JavaScriptCore that is bundling an unsupported version of WebKit.
As @chrisradek mentioned, the linked patch should address any undefined
identifiers on a standards compliant JavaScript engine. Even if this patch were to be changed to explicitly check for undefined
, there are other issues that you may run into with native JavaScript API support.
There have been other issues reported when using using Appcelerator and Appcelerator like environments that use an outdated version of JavaScriptCore. See #784
@jeskew While it is'nt Appcelerator in particulr but our platform pretty much does the same thing, and it does use an older version of Webkit.
@AdityaManohar Thanks for the update, I have already run into some issues because of this, I am trying to see if I can get this to work as that will reduce our effort significantly. Our other options are to incorporate both iOS and Android sdk for respective environments, or use REST APIs(where we end up redoing a lot of things that aws-sdk does for us)
I am not sure if this is the right forum for this but will just put is out there, does AWS firehose have REST APIs that we can access to put records?
@neeravmehta AWS Kinesis Firehose does have a public REST API that you can use but you may still need the SDK to sign requests (or some other equivalent Signature Version 4 signer). Here is the API documentation for AWS Kinesis Firehose.
Your other alternative is to try and use Amazon API Gateway to proxy requests to AWS Kinesis Firehose. This becomes trivially simple if you are using unauthenticated roles to put records to Kinesis Firehose.
Let me know if the helps. Here is a comment that I posted on using API Gateway with CloudSearch - the same concepts apply.
You need to check for existance of ArrayBuffer before using it. this is happening in hash function for the crypto module. Specifically line 4270 in a development build with only firehose, cognito and mobile analytics services. Search for
data.buffer instanceof ArrayBuffer