upstash / qstash-js

Message queue for serverless
https://docs.upstash.com/qstash
MIT License
133 stars 11 forks source link

Incompatible with Cloudflare Workers #48

Closed mattfysh closed 10 months ago

mattfysh commented 10 months ago

The jose dependency uses a number of nodejs native APIs that are not currently supported by default on Cloudflare. I found usage of "buffer" and "crypto" but there may be others

"buffer" can be supported on cloudflare if your worker has nodejs compatibility switched on, but only if the import includes the "node:" prefix, which jose does not currently do.

"crypto" is not supported at all, the only replacement would be the Web Crypto API

Effectively this means the v2 SDK cannot be used on Cloudflare in its current form, and the only way to use V2 Qstash from Cloudflare is to call the HTTP endpoints directly

mattfysh commented 10 months ago

Fixed by adding the "browser" condition to the esbuild options