Skip to content
Nilay Kabariya

Entry No.027·Deploy··3 min read

Fix: Error 1101 Worker threw exception (Cloudflare Workers)

Cloudflare's 1101 page hides the real error. See it with one command, plus six causes reproduced on a deployed Worker, each with its exact log message.

by Nilay#cloudflare#workers#wranglerDEPLOY

The error, verbatim

Jump to the fix ↓
Error 1101
Worker threw exception

# the same request from curl:
HTTP 500
error code: 1101

# npx wrangler tail --format pretty, same request:
GET https://nk-repro-cpu.nilaykabariya12.workers.dev/binding - Exception Thrown
X [ERROR] TypeError: Cannot read properties of undefined (reading 'get')
      at handle (index.js:54:31)
✓ Reproduced on Windows 11 Pro

Tested on

wrangler
4.139.0
Worker
compatibility_date 2026-09-01, nodejs_compat
OS
Windows 11 Pro
Contents
  1. The fix01
  2. Six causes, each reproduced02
  3. Stop visitors seeing the 1101 page03
  4. If you’re a visitor, not the site owner04
  5. What didn’t work05
  6. How this was tested06

Error 1101 means your Worker’s code threw an error while handling the request, so Cloudflare answered with its own error page instead. That page never says what went wrong. The real error is in your Worker’s logs.

The fix

1. See the real error. In your project folder, stream the live logs, then reload the page that shows 1101:

npx wrangler tail --format pretty

Each failed request prints the actual exception and where it happened:

GET https://nk-repro-cpu.nilaykabariya12.workers.dev/binding - Exception Thrown
X [ERROR] TypeError: Cannot read properties of undefined (reading 'get')
      at handle (index.js:54:31)

2. Make the line number point at your code. index.js:54 is a line in the bundle wrangler uploaded, not in your file. Add this to your wrangler config and deploy again:

// wrangler.jsonc
"upload_source_maps": true

3. Find the message in the table below and fix that line.

Six causes, each reproduced

Each of these returned Error 1101, and each one logs a different message:

Your code What wrangler tail shows Fix
Reads a property of something that’s undefined TypeError: Cannot read properties of undefined (reading 'email') Check the value exists before using it
Uses a binding (KV, D1, R2…) that isn’t in the config you deployed TypeError: Cannot read properties of undefined (reading 'get') Declare the binding in the wrangler config you deploy with
Returns a string or object instead of a Response TypeError: Incorrect type for Promise: the Promise did not resolve to 'Response'. Return new Response(...) or Response.json(...)
Calls fetch('/api/data') with a relative URL TypeError: Invalid URL: /api/data Give fetch a full URL, starting with https://
Calls request.json() on a request with no body SyntaxError: Unexpected end of JSON input Only parse JSON on requests that send it, and answer 400 when it’s invalid
Waits on a promise that never settles Error: The Workers runtime canceled this request because it detected that your Worker's code had hung and would never generate a response. Find the await that never finishes

Stop visitors seeing the 1101 page

An error you don’t catch becomes Cloudflare’s page. Catch it yourself, log it, and send your own response:

export default {
  async fetch(request, env) {
    try {
      return await handle(request, env);
    } catch (err) {
      console.error(err);
      return new Response('Something went wrong', { status: 500 });
    }
  },
};

One side effect to know about: wrangler tail now marks those requests Ok, because the Worker did return a response. Search the log lines, not the status.

If you’re a visitor, not the site owner

The page means that site’s own code crashed on your request. It’s almost never something on your side, and only the site’s owner can fix it. Reloading won’t help: in my tests the same request failed again on every retry, five times in a row for one of them.

What didn’t work

How this was tested

One test Worker deployed with wrangler 4.139.0 to workers.dev, with a route for each cause in the table, plus the same routes wrapped in try/catch. Each route was requested with curl (and one in a browser, for the page text), and every message above is copied from wrangler tail --format pretty for that request. Source maps were checked by redeploying with "upload_source_maps": true and triggering the same errors.

— N.K., end of entry No.027

Useful? Pass it on:Post on XFollow @EmotionalMatter

Related entries

  1. No.035

    Fix: Script startup exceeded CPU time limit (Workers 10021)

    Cloudflare rejects your Worker deploy with Script startup exceeded CPU time limit. How to see which code is slow, and the fix that removes it, measured.

    > X [ERROR] Your Worker failed validation because it exceeded startup limits.

    DEPLOY2 min
  2. No.034

    Fix: The uploaded script has no registered event handlers

    Cloudflare rejects your Worker with no registered event handlers (code 10068), or accepts it and serves a 404. Three ways it happens, tested on a deploy.

    > X [ERROR] A request to the Cloudflare API (/accounts/.../workers/scripts/nk-repro-cpu) failed.

    DEPLOY2 min
  3. No.026

    Cloudflare 1102: Worker exceeded resource limits / CPU time limit

    Cloudflare Workers Error 1102. Why sign-ups with better-auth trip it, why it only fails sometimes, and what fixes it, measured on a deployed Worker.

    > Error 1102

    DEPLOY4 min

Post card · Newsletter

Get the next fix in your inbox.

One short email when a new entry is published. No spam, never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text