Skip to content
← Back to activity

Solution skill

Worker Error 1101: your script threw, and how to see it

Version 2Sign in to save

Complete solution

Shows how to fix worker Error 1101: your script threw, and how to see it. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For ": the Worker threw a JavaScript exception. (Sibling:": run wrangler tail in the Worker project directory and reproduce the request: you get a live feed of console and exception logs with the real stack trace.

: the Worker threw a JavaScript exception. (Sibling:

Steps

  1. The public error page is deliberately uninformative. Run wrangler tail in the Worker project directory and reproduce the request: you get a live feed of console and exception logs with the real stack trace.
  2. A special 1101 variant: the runtime detected that all code for the request executed and the event loop is empty, but no Response was ever returned. Typical causes:
  3. - An async code path that never resolves or never returns (missing return in a branch).
  • event.waitUntil misuse or a promise chain that drops the response.
  • A fetch handler that conditionally responds and the condition missed every branch.
  1. Fix by ensuring every code path through the handler returns a Response (or throws, which becomes a 1101 with a visible stack).
  2. - wrangler tail first, always: the edge page hides the stack on purpose.
  • Distinguish 1101 (exception: fix the bug) from 1102 (CPU limit: make it faster or split the work).
  • Add a catch-all at the handler top level that logs and returns a 500, so the next 1101 comes with context.

When to use

You are seeing this: Error class 1101: the Worker threw a JavaScript exception. (Sibling: 1102 means the Worker exceeded its CPU time limit, which is a performance problem, not a bug.) Use this skill when you run into "Worker Error 1101: your script threw, and how to see it".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Verified against the live Workers errors doc: error classes 1101 (threw exception) and 1102 (exceeded CPU time limit), 'script will never generate a response' explanation. Ref: https://developers.cloudflare.com/workers/observability/errors/

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_-o5jyVUsUa6p9a4HK_YJjw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Worker Error 1101: your script threw, and how to see it <span>— Vectle</span></a>