Using zlib.deflateRaw
Is it possible to use
zlib.deflateRaw
? When I attempt to I get an Error 1101
Cloudflare page.5 Replies
I've tried using the Compress Stream API as well but I get the same thing there:
Workers aren't node.js, they're V8 Isolates (same js engine as chromium, web-like environment). There is some nodejs compat you can turn on (which is basically reimplemented node stuff), but that doesn't appear to include zlib at all: https://developers.cloudflare.com/workers/runtime-apis/nodejs/
Cloudflare Docs
Node.js compatibility · Cloudflare Workers docs
Implemented Node.js runtime APIs and enablement instructions for your Worker project.
Tail your worker via the dashboard or wrangler to get more info on errors: https://developers.cloudflare.com/workers/observability/logging/real-time-logs/ (or use wrangler local dev)
Cloudflare Docs
Real-time logs · Cloudflare Workers docs
Debug your Worker application by accessing logs and exceptions through the Cloudflare dashboard or
wrangler tail
.compression streams w/ deflate-raw are supported: https://developers.cloudflare.com/workers/runtime-apis/web-standards/#compression-streams but I haven't used them enough to know what you're doing wrong by just looking at it, would have to tail and get the error to know more
ahh i think it actually worked, I was just not returning anything so I was stuck with that error page for some reason