What breaks when you ship Next.js on Cloudflare Workers
The article discusses the challenges of deploying Next.js applications on Cloudflare Workers. It highlights specific npm packages that are incompatible with the Workers runtime and suggests alternatives. The author shares insights on handling session cookies and optimizing caching patterns for better performance.
- ▪Common npm packages like bcrypt and cheerio do not work in the Cloudflare Workers runtime.
- ▪The author replaced bcrypt with Argon2id and cheerio with htmlparser2 for better compatibility.
- ▪Session management with Yahoo Finance requires a specific handshake process to obtain necessary cookies and tokens.
Opening excerpt (first ~120 words) tap to expand
← Back to blogMay 16, 2026· cloudflare · nextjs · javascriptWhat breaks when you ship Next.js on Cloudflare WorkersA log of which npm packages don't survive the Workers runtime, what to swap them with, and the patterns that ended up mattering.I've been building Finterm, a financial terminal that runs entirely in a browser tab, on Cloudflare Workers via @opennextjs/cloudflare. The promise is the obvious one — global edge runtime, near-zero cold starts, pay-per-request pricing. The catch is that Workers don't run Node.js.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Finterm.