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)
Tested on
- wrangler
- 4.139.0
- Worker
- compatibility_date 2026-09-01, nodejs_compat
- OS
- Windows 11 Pro
Contents
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 prettyEach 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": true3. 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