Skip to content
Nilay Kabariya

Entry No.025·Deploy·Updated ·4 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.

What changed on Nov 8, 2026: Re-ran all six causes on wrangler 4.158.0: same 500 / error 1101 and the same messages in wrangler tail.

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

The fix that worked

See the real error, then fix that line:

npx wrangler tail --format pretty
Not it? Every cause, tested ↓

Tested on

wrangler
4.139.0; 4.158.0 (November 8)
Worker
compatibility_date 2026-09-01, nodejs_compat
OS
Windows 11 Pro

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

If the message is D1_ERROR: D1 query result exceeded the maximum response size limit of 50 MB, the code is fine but the query now returns more than D1 allows: the D1 50 MB limit, tested.

I re-ran all six on November 8, 2026 with wrangler 4.158.0: every route still returned HTTP 500 with error code: 1101, and wrangler tail logged the same six messages, word for word:

Terminal: requests to a test Worker; /ok returns 200, and /undefined, /binding, /not-response, /relative-fetch, /json-no-body and /hang each return HTTP 500 with outcome exception and the TypeError, SyntaxError or hung-request message from wrangler tail.
One request per cause, with the outcome and exception from wrangler tail. The last message is cut at the line end. Full log.

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

The test Worker

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.

November 8, 2026: the six causes again with wrangler 4.158.0 and compatibility_date 2026-11-01, one route each, logged with wrangler tail --format json. The Worker, config, curl results and tail log are public.

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

Useful? Pass it on:Post on XFollow @EmotionalMatter

Related entries

  1. No.066

    Deno Deploy shutdown: move to Workers or Node, tested

    Deno Deploy closes in about six months. I moved a typical Deno Deploy app to Cloudflare Workers and to Node 26: every error, and what fixed each.

    > Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'jsr:'

    DEPLOY3 min
  2. No.033

    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.

    DEPLOY4 min
  3. No.032

    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. Seven handler shapes tested, Hono included.

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

    DEPLOY3 min

tip: paste the exact error text