Cloudflare Error 1101: Worker threw exception

The Cloudflare Worker serving this route threw an uncaught JavaScript exception.

Seen on: Cloudflare

Meaning

Undefined variables, failed fetches without try/catch, missing bindings (KV, env vars, secrets) or returning a non-Response value all end in 1101. wrangler tail shows the stack trace.

Common causes

  • Uncaught exception in Worker code
  • Missing binding/secret (env.X undefined)
  • Returning something other than a Response
  • Subrequest failure not handled

⚡ Quick fix

  1. Run wrangler tail and reproduce
  2. Wrap risky code in try/catch and return a Response
  3. Check bindings in wrangler.toml and secrets in the dashboard

Detailed fix by platform

JavaScript

  1. javascript
    export default {
      async fetch(request, env) {
        try {
          return await handle(request, env);
        } catch (err) {
          console.error(err.stack);
          return new Response('Internal error', { status: 500 });
        }
      }
    };

How to diagnose

  1. Logs — wrangler tail exception
  2. Bindings — env.* defined?
  3. Return — Always a Response?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.