Starting with Wrangler 4.150.0, the wrangler deploy, wrangler versions upload, and wrangler preview commands automatically create and push source maps for Cloudflare Workers. The cf CLI mirrors this behavior, and the Cloudflare Vite plugin (≥ 1.64.0) now emits source maps by default. Practitioners no longer have to enable upload_source_maps to see original file names and line numbers in stack traces.
Why the Change Matters to Practitioners
Source maps let you map minified or bundled code back to the original source, turning opaque error logs into actionable diagnostics. For AI engineers iterating on model‑inference Workers, platform engineers maintaining multi‑service edge runtimes, DevOps/SRE teams handling rollouts, and security engineers auditing runtime behavior, immediate access to readable stack traces reduces mean‑time‑to‑resolution and simplifies incident post‑mortems. Because the maps are applied after the Worker executes, they do not increase CPU consumption, bundle size, or cold‑start latency.
Operational Impact and Configuration Options
With the defaults in place, most CI/CD pipelines can drop explicit upload_source_maps settings. However, the tooling still respects the flag, allowing you to opt out or enforce stricter upload rules:
- To disable automatic upload in Wrangler, set
upload_source_maps = falseinwrangler.tomlor{ "upload_source_maps": false }in a JSONC config. - To prevent cf CLI or the Vite plugin from emitting maps, set
build.sourcemap = falsein the Vite configuration. - If you prefer a failed deployment when an external source map cannot be resolved, set
upload_source_maps = true. By default, unresolved maps (e.g., inlinedata:URLs) are skipped without aborting the upload.
# Example wrangler.toml snippet
upload_source_maps = false
Security and Confidentiality Considerations
Uploading source maps makes the original source code available to Cloudflare’s observability services (Workers Logs, real‑time logs, Tail Workers, and Workers Issues). While this aids debugging, it also means that any proprietary logic or secrets embedded in the source become accessible to anyone with read access to those logs. Teams should evaluate whether the benefits of automatic debugging outweigh the risk of inadvertent code exposure. If confidentiality is a priority, explicitly disable source‑map generation or upload.
Related CloudNinjas coverage: hands-on guides.
What This Means For Practitioners
Adopt the new defaults to streamline deployments and gain richer error reporting without performance penalties. Verify that your build process (especially custom builds) produces the expected external source maps, and confirm that your observability pipelines ingest the remapped stack traces. If your organization has strict code‑privacy policies, add upload_source_maps = false (Wrangler) or build.sourcemap = false (Vite) to your configuration and test that deployments still succeed. Finally, monitor the Workers logging interfaces to ensure that the newly available source‑map data is being leveraged effectively in incident response workflows.
