-
Notifications
You must be signed in to change notification settings - Fork 601
Closed
Description
zlib.inflateRawSync throws Uncaught RangeError: Memory limit exceeded when maxOutputLength is set to exactly the expected inflated size of a zip file. Incrementing it by 1 resolves the issue.
Setup
wrangler.jsonc:
The following fails in a Cloudflare Worker with the error above:
import AdmZip from 'adm-zip';
import compressedData from './compressed.zip';
const zip = new AdmZip(compressedData);
const zipEntry = zip.getEntries()[0].getData();adm-zip passes the exact expected size as maxOutputLength to zlib.inflateRawSync. The issue originates here and paching it to use expectedLength + 1 fixes the issue:
This seems to be a bug with the workerd implementation of zlib.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels