Browser tab freezes when using unzip
See original GitHub issueI am using fflate in a Vue.js 3 app and it it really a lot faster than other packages 😃
However, I have the following problem (not sure if it’s a bug or if I’m just using it wrong): I’m using unzip to extract a lot of xml files from a zip archive, parse them and push them into a store. As soon as the unzipping operation is started the UI of my vue app completely freezes, nothing is clickable anymore and my loading animation also stops moving.
My code looks like this:
loading.value = true
const fileBuffer = await file.file.arrayBuffer()
const archive = new Uint8Array(fileBuffer)
const unzippedFiles = []
unzip(archive, (err, unzipped) => {
if (err) {
console.log(err)
}
for (const file in unzipped) {
const fileString = strFromU8(unzipped[file])
unzippedFiles.push(parser.parse(fileString, {}, true))
}
})
store.setDocuments(unzippedFiles)
loading.value = false
What can I do to prevent the freezing? Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Opening Zip files on Windows 10 freezes Explorer every time
I put Windows 10 on fresh over a month ago but I have an issue with all zip files regardless of size. If...
Read more >Here Are Full Solutions If Google Chrome Freezes Windows 10
Step 1: In Chrome, click on the three dots, choose More tools and click Clear browsing data. Alternatively, you can use the shortcut...
Read more >DevTools causing browser to freeze - google chrome
When loading a specific website at work and opening the Chrome devtools, the website's tab gets frozen, Chrome task manager shows > 100%...
Read more >Zip files crashes Windows Explorer | Windows 11 Forum
I have a very duplicatable issue where Windows Explorer constantly crashes (restarts) when clicking on or attempting to unzip a file.
Read more >Chrome Becomes Unresponsive or Crashes on Facebook
Going to Facebook, clicking on a link, opening a tab, pretty much doing ... I'm no longer using Chrome as default browser because...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok that’s fine. I’m going to guess that this will be solved by compressing as many files as possible on another thread rather than having an arbitrary byte cutoff by implementing the worker pool from #58, so I’m closing in favor of that issue. If you want to know when this is resolved follow #58; for now you should probably just make a web worker manually and call
unzipSync
.@101arrowz Sorry, I’m not allowed to send it because it contains confidential information. I understand if you can’t investigate any further in this.