I am trying to read a xlsx file that has a size of 3000KB and convert it to JSON using SheetJS, but when I read the file I seem to get a chrome 'Page Unresponsive error', clicking wait on the error everytime I upload a file is not ideal.
How can I resolve this issue?
onChange(event) {
this.file = event.target.files ? event.target.files[0] : null;
this.uploaded = true;
const reader = new FileReader();
reader.readAsArrayBuffer(this.file);
reader.onload = function () {
const data = new Uint8Array(reader.result);
const wb = XLSX.read(data, { type: 'array', sheets: ['Sheet1', 'Sheet2'] });
this.summary = XLSX.utils.sheet_to_json(wb.Sheets.Summary);
this.weeklyDetails = XLSX.utils.sheet_to_json(wb.Sheets['Weekly Details']);
console.log(this.weeklyDetails);
};
},