max-mapper / max-mapper/extract-zip
Zip extraction fail in Node 26.1.0
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 398
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
In Node 26.1.0, extract-zip fails to completely extract zip files with an unsettled async process. It seems to occur when the first larger file is being extracted.
To reproduce, running this test-extract-zip.js file against test/github.zip in this repo on Node 26.1.0:
import extract from "extract-zip";
try {
await extract("/app/github.zip", {
dir: "/app",
onEntry: (entry) => {
console.log(`Extracting: ${entry.fileName}`);
},
});
console.log("done");
} catch (err) {
console.error("Extraction failed:", err);
}
In Node 26.1.0 on Linux (at least the Debian Trixie/Bookworm and Alpine containers) produces the following (also seen with other zip files):
# node test-extract-zip.js
Extracting: extract-zip-master/
Extracting: extract-zip-master/.gitignore
Extracting: extract-zip-master/.npmignore
Extracting: extract-zip-master/.travis.yml
Extracting: extract-zip-master/CONTRIBUTING.md
Extracting: extract-zip-master/cli.js
Extracting: extract-zip-master/index.js
Extracting: extract-zip-master/package.json
Extracting: extract-zip-master/readme.md
Extracting: extract-zip-master/test/
Extracting: extract-zip-master/test/cats.zip
Warning: Detected unsettled top-level await at file:///app/test-extract-zip.js:4
await extract("/app/github.zip", {
^
Running on Node 26.0.0 (and other previous version), the extraction completes as expected:
# node test-extract-zip.js
Extracting: extract-zip-master/
Extracting: extract-zip-master/.gitignore
Extracting: extract-zip-master/.npmignore
Extracting: extract-zip-master/.travis.yml
Extracting: extract-zip-master/CONTRIBUTING.md
Extracting: extract-zip-master/cli.js
Extracting: extract-zip-master/index.js
Extracting: extract-zip-master/package.json
Extracting: extract-zip-master/readme.md
Extracting: extract-zip-master/test/
Extracting: extract-zip-master/test/cats.zip
Extracting: extract-zip-master/test/test.js
done
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the provided test-extract-zip.js reproduction against test/github.zip on Node 26.1.0 and compare it with Node 26.0.0. Trace the extraction path exercised by that reproduction, then verify the fix by confirming all archive entries are extracted and the script prints “done” without an unsettled top-level await warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100