Skip to content

[Workers] Recommend source maps across Worker examples - #34185

Merged
nevikashah merged 1 commit into
productionfrom
bib/source-maps-defaults
Oct 12, 2026
Merged

nevikashah merged 1 commit into
productionfrom
bib/source-maps-defaults

Conversation

@irvinebroque

@irvinebroque irvinebroque commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Recommend source maps for every JavaScript and TypeScript Worker so production errors and stack traces point to the original source. Add upload_source_maps: true to complete Worker configuration examples across product guides and reusable snippets, and connect the recommendation to errors, logs, and Issues.

{
  "upload_source_maps": true
}

Explain that framework builds must generate external server source maps, show Vite configuration, document opt-outs, and keep server maps out of public assets. Correct the version-upload guidance to use wrangler versions upload.

refs https://developers.cloudflare.com/workers/observability/profiling-in-production/ and https://blog.cloudflare.com/workers-on-demand-profiling/

Without this — debugging in production is harder. You don't get stack traces for exceptions that map back to source code. And your production profiles are harder to reason about, since they don't point back to the right line numbers in source code.

Related changes: SDK defaults and framework templates.

@github-actions github-actions Bot added product:workers Related to Workers product product:stream Related to Stream product product:cloudflare-one product:r2 R2 object storage: https://developers.cloudflare.com/r2 product:queues Cloudflare Queues: https://developers.cloudflare.com/queues product:d1 D1: https://developers.cloudflare.com/d1/ product:cloudflare-for-platforms product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ product:radar product:kv product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ product:workflows Workflows: https://developers.cloudflare.com/workflows/ product:pipelines product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. product:secrets-store product:containers product:ai-search product:workers-vpc product:sandbox product:browser-run product:artifacts http://developers.cloudflare.com/artifacts/ product:dynamic-workers product:email-service product:agent-memory Related to Agent Memory product product:access product:web-search size/m labels Oct 10, 2026
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

AI Review

✅ Reviewed 9df581e · 4 findings · incremental

👉 Fix in your agent 👈
Fix the following review findings in PR #34185 (https://github.com/cloudflare/cloudflare-docs/pull/34185).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification.
- If you disagree, explain why.
- If you need clarification before deciding, ask those questions.
- Then share your plan for which issues to tackle and in what order.

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit because the next review reads PR comments.

## Code Review
- C-00f99393 | src/content/docs/workers/static-assets/migration-guides/migrate-from-pages.mdx:164 | Comment describing `main` is now attached to `upload_source_maps`
  The comment `// or some other location if you moved the script out of the static asset directory` explains the value of the `main` field that previously carried it, but this PR moved it onto the new `upload_source_maps` line. As written, the example implies the comment describes `upload_source_maps`, which is misleading; the comment should stay with `main`.
  ```txt
  "upload_source_maps": true, // or some other location if you moved the script out of the static asset directory
  ```

## Style Guide
- S-04b7a797 | src/content/docs/workers/vite-plugin/get-started.mdx:78 | Directional word `above` in prose
  The added prose uses the directional word `above` ("in the Vite configuration above"). Per the style guide, directional words must be replaced with a direct reference by name or link.
- S-0e3b27f2 | src/content/docs/workers/vite-plugin/get-started.mdx:78 | `see [link]` should be `refer to [link]`
  The added prose uses `see [Vite Environments]` before a link. The style guide requires `refer to [Page Title]` phrasing instead of `see [link]`.
- S-1f7085b0 | src/content/docs/workers/vite-plugin/get-started.mdx:57 | Missing serial comma before final `or`
  The list `` `wrangler.jsonc`, `wrangler.json` or `wrangler.toml` `` has three items joined by `or` with no comma before the final conjunction; the serial comma is required.

Code Review

  • src/content/docs/workers/static-assets/migration-guides/migrate-from-pages.mdx:164 · Comment describing main is now attached to upload_source_maps

    The comment // or some other location if you moved the script out of the static asset directory explains the value of the main field that previously carried it, but this PR moved it onto the new upload_source_maps line. As written, the example implies the comment describes upload_source_maps, which is misleading; the comment should stay with main.

    "upload_source_maps": true, // or some other location if you moved the script out of the static asset directory

Style Guide

  • src/content/docs/workers/vite-plugin/get-started.mdx:78 · Directional word above in prose

    The added prose uses the directional word above ("in the Vite configuration above"). Per the style guide, directional words must be replaced with a direct reference by name or link.

  • src/content/docs/workers/vite-plugin/get-started.mdx:78 · see [link] should be refer to [link]

    The added prose uses see [Vite Environments] before a link. The style guide requires refer to [Page Title] phrasing instead of see [link].

  • src/content/docs/workers/vite-plugin/get-started.mdx:57 · Missing serial comma before final or

    The list `wrangler.jsonc`, `wrangler.json` or `wrangler.toml` has three items joined by or with no comma before the final conjunction; the serial comma is required.

Commands
  • /review Run a review now.
  • /full-review Review the entire PR diff.
  • /disable-auto-review Stop automatic reviews.
  • /rebase Rebase against production.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://bib-source-maps-defaults.previews.developers.cloudflare.com (commit 9df581e)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://7e53a721.previews.developers.cloudflare.com 9df581e 2026-10-10T18:50:04.890Z Visit the dashboard ↗

@github-actions

Copy link
Copy Markdown
Contributor

Preview URL: https://9df581eb.preview.developers.cloudflare.com
Preview Branch URL: https://bib-source-maps-defaults.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/workers/observability/source-maps/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/observability/source-maps/
https://developers.cloudflare.com/workers/best-practices/workers-best-practices/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/best-practices/workers-best-practices/
https://developers.cloudflare.com/workers/vite-plugin/get-started/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/vite-plugin/get-started/
https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/
https://developers.cloudflare.com/stream/edit-videos/applying-watermarks/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/stream/edit-videos/applying-watermarks/
https://developers.cloudflare.com/workers/wrangler/configuration/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/wrangler/configuration/
https://developers.cloudflare.com/workers/cache/configuration/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/cache/configuration/
https://developers.cloudflare.com/workers/cache/examples/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/cache/examples/
https://developers.cloudflare.com/stream/edit-videos/adding-captions/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/stream/edit-videos/adding-captions/
https://developers.cloudflare.com/stream/viewing-videos/download-videos/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/stream/viewing-videos/download-videos/
https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/http/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/http/
https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/
https://developers.cloudflare.com/workers/runtime-apis/rpc/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/workers/runtime-apis/rpc/
https://developers.cloudflare.com/agents/harnesses/think/getting-started/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/agents/harnesses/think/getting-started/
https://developers.cloudflare.com/stream/manage-video-library/creator-id/ https://bib-source-maps-defaults.preview.developers.cloudflare.com/stream/manage-video-library/creator-id/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:access product:agent-memory Related to Agent Memory product product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. product:ai-search product:artifacts http://developers.cloudflare.com/artifacts/ product:browser-run product:cloudflare-for-platforms product:cloudflare-one product:containers product:d1 D1: https://developers.cloudflare.com/d1/ product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ product:dynamic-workers product:email-service product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ product:kv product:pipelines product:queues Cloudflare Queues: https://developers.cloudflare.com/queues product:r2 R2 object storage: https://developers.cloudflare.com/r2 product:radar product:sandbox product:secrets-store product:stream Related to Stream product product:web-search product:workers Related to Workers product product:workers-vpc product:workflows Workflows: https://developers.cloudflare.com/workflows/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants