Read Cloudflare Worker Errors at Their Original File and Line
The Worker deploys, yet production errors still point into one bundled index.js. Why isn't Wrangler's new source map default showing your TypeScript lines?

- Wrangler 4.150.0 generates and uploads Worker source maps by default.
- A framework or custom bundler must produce external maps for Wrangler to upload.
- The default skips unresolved maps. Explicit
upload_source_maps: truemakes those failures visible during upload.
Check the Wrangler version used to deploy
A production stack pointing into one bundled index.js needs source maps to identify the original TypeScript location. Cloudflare’s October 20 update makes map generation and upload the default in Wrangler 4.150.0 for deploy, versions upload and preview, unless disabled.
Earlier supported versions require explicit opt-in. Remapped stacks can appear in Workers Logs, real-time logs, Tail Workers and Issues, but uploading maps does not enable every collection feature. Issues requires separate activation and processes new traffic rather than historical failures.
Pass caught exceptions to the logger as objects
When your application catches an error and returns a fallback response, pass the caught value to console.error(). Cloudflare’s exception logging support retains the exception name, message and stack.
// Inside the request handler's catch block
catch (error) {
console.error("Request failed:", error);
return new Response("Service unavailable", { status: 503 });
} Reading error.stack inside the Worker is different. Remapping happens after execution; the runtime property is not rewritten. An unchanged stack string alone does not prove that the upload failed.
With Issues enabled, inspect a new occurrence after the application records the caught error. Enabling it will not backfill older failures.
A successful upload can still skip a map
If Vite or another tool creates the bundle, it must also create the maps. Cloudflare Vite plugin 1.64.0 produces external maps for the Worker environment by default. Other bundlers must preserve both the map files and their sourceMappingURL references.
| Setting | Unresolved maps |
|---|---|
| New Wrangler default | Skipped while the upload continues. |
upload_source_maps: true | Cause the upload to fail. |
upload_source_maps: false | No source-map upload. |
Inline data: maps and references to missing files can be skipped. Inspect build output when deployment succeeds but locations remain wrong. Individual frames that cannot be remapped also remain unchanged.
You do not need to disable maps to save runtime work
Cloudflare says the processing does not increase Worker CPU time, bundle size or cold starts. If you do opt out, use the setting for your deployment tool: upload_source_maps: false for Wrangler, or build.sourcemap: false in the Worker’s Vite environment for a cf project. cf deploy uploads every map present in its build output.
The Worker default does not add maps to Vite’s client assets. Keep server maps out of public asset directories in custom builds, then verify that a new error points to the source location you expect.