-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RangeError: Maximum call stack size exceeded. #137
Comments
thanks! |
Interesting — @smakinson, would you mind please doing a pull request and adding a test? Would be most appreciated! Marking as bug for 0.10.7 release. |
I haven't seen this issue and it might be interesting to see if the solution I provide in this article solves it. |
Bumping to 0.10.8, we really need to release 0.10.7. |
We couldn't replicate this issue, so I'm closing it. Feel free to open the issue again if the bug occurs again. |
it helps.thanks. |
I am using your lib to upload images to github and I came across this error "RangeError: Maximum call stack size exceeded." in chrome & safari when uploading. I found this discussion:
http://stackoverflow.com/questions/3195865/converting-byte-array-to-string-in-javascript
and I tried the suggestion in lovasoa's toBinString function and changed the code around line 366 from:
content = {
"content": btoa(String.fromCharCode.apply(null, new Uint8Array(content))),
"encoding": "base64"
};
to
var uarr = new Uint8Array(content);
var strings = [], chunksize = 0xffff;
var len = uarr.length;
// There is a maximum stack size. We cannot call String.fromCharCode with as many arguments as we want
for (var i = 0; i * chunksize < len; i++){
strings.push(String.fromCharCode.apply(null, uarr.subarray(i * chunksize, (i + 1) * chunksize)));
}
content = {
"content": btoa(strings.join('')),
"encoding": "base64"
};
It seems to work now. I have not done tons of testing, but I thought I'd file a bug if someone has some time to check it out.
The text was updated successfully, but these errors were encountered: