
I tried every axios alternative. None of them worked on Cloudflare Workers. So I built one.
It started with a Cloudflare Worker. I had a simple task, hit an external API from a Worker, return the data. I reached for axios like I always do. Deployed it. Got this: Error: Cannot read properties of undefined (reading 'prototype') axios doesn't run on Cloudflare Workers. It depends on Node.js built-ins that the edge doesn't have. Fine. I'll switch. The search for an alternative Got — huge ecosystem, great docs. Dropped CommonJS in v12. My project uses require() . Hard pass. Ky — clean API, zero deps. Browser-first. No Node.js support, no proxy, can't use it on the server side of my stack. node-fetch — a polyfill. Node.js has had native fetch since v18. Why am I installing a polyfill for something that already exists? redaxios — tiny, but it's just a thin axios-compatible wrapper around fetch. No retries, no interceptors, no auth helpers. ofetch — closest to what I wanted, but no request deduplication, no in-memory cache, and the TypeScript types felt incomplete. Every option had a
Continue reading on Dev.to Webdev
Opens in a new tab




