-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
BUG: XLSX > 0.18.1+ Causing STATUS_BREAKPOINT (Web worker) on Chromium Browsers #2616
Comments
How big is "large"? can you share a file? |
sample file |
Quick patch (feel free to send PR): diff --git a/bits/20_jsutils.js b/bits/20_jsutils.js
@@ -109,7 +109,22 @@ function cc2str(arr/*:Array<number>*/, debomit)/*:string*/ {
}
return arr.toString("binary");
}
- /* TODO: investigate performance degradation of TextEncoder in Edge 13 */
+ if(typeof TextDecoder !== "undefined") try {
+ if(debomit) {
+ if(arr[0] == 0xFF && arr[1] == 0xFE) return new TextEncoder("utf-16le").decode(arr.slice(2));
+ if(arr[0] == 0xFE && arr[1] == 0xFF) return new TextEncoder("utf-16be").decode(arr.slice(2));
+ var rev = {
+ "\u20ac": "\x80", "\u201a": "\x82", "\u0192": "\x83", "\u201e": "\x84",
+ "\u2026": "\x85", "\u2020": "\x86", "\u2021": "\x87", "\u02c6": "\x88",
+ "\u2030": "\x89", "\u0160": "\x8a", "\u2039": "\x8b", "\u0152": "\x8c",
+ "\u017d": "\x8e", "\u2018": "\x91", "\u2019": "\x92", "\u201c": "\x93",
+ "\u201d": "\x94", "\u2022": "\x95", "\u2013": "\x96", "\u2014": "\x97",
+ "\u02dc": "\x98", "\u2122": "\x99", "\u0161": "\x9a", "\u203a": "\x9b",
+ "\u0153": "\x9c", "\u017e": "\x9e", "\u0178": "\x9f"
+ };
+ return new TextDecoder("latin1").decode(arr).replace(/[\x80\x9F]/g, function(c) { return rev[c] || c; });
+ }
+ } catch(e) {}
var o = [];
for(var i = 0; i != arr.length; ++i) o.push(String.fromCharCode(arr[i]));
return o.join(""); |
Thanks @SheetJSDev, I will test that and send a PR. |
|
Hello,
A one month ago I started to face a bug STATUS_BREAKPOINT on chromium browsers like google chrome/microsoft edge
it happen when I load a 'large xlsx' using a Web Workers.
ps: it doesn't happen on Firefox browsers and without webworker seems work fine.
To Reproduce
you can go to https://oss.sheetjs.com/ and load a big xlsx that prompt webworker message, press ok, and wait you get a browser error
my current workaround to fix it. it is fix XLSX version on 0.18.0 that I don't have this problem.
Thanks
The text was updated successfully, but these errors were encountered: