@upstash/redis on Node 14: "Unable to decode base64 []: atob is not defined"

Since @upstash/redis v1.14.0, running on Node 14 (e.g. Vercel with the Node 14.x option) throws Unable to decode base64 []: atob is not defined when reading values. Cause: v1.14.0 introduced base64 decoding via atob, which only exists in Node v16+ (and browsers) — it was never defined in Node 14.

Upgrade to Node 16+, or add a polyfill at the top of your API route: if (typeof atob === 'undefined') { global.atob = (b64) => Buffer.from(b64, 'base64').toString('utf-8'); }. Downgrading to @upstash/redis 1.13.1 also avoids it. The maintainer acknowledged the bug and shipped a fix in the SDK. Source: https://github.com/upstash/redis-js/issues/216