Repository navigation
[wrangler] Upload source maps by default - #16231
Conversation
🦋 Changeset detectedLatest commit: fa5e9cf The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
P2: Preserve the opt-in behavior of other The new
|
|
I'm Bonk, and I've done a quick review of your PR. Defaults source-map generation and uploads for deploys and versions uploads.
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
0478c2c to
eb976df
Compare
eb976df to
83dc0c3
Compare
|
Codeowners approval required for this PR:
Show detailed file reviewers |
83dc0c3 to
32c878a
Compare
`upload_source_maps` now defaults to on for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` when it isn't set in config or via `--upload-source-maps`, so stack traces point at original source without extra setup. `wrangler build --experimental-cf-build-output` keeps its opt-in behaviour. When defaulted, source maps that can't be resolved (inline `data:` maps, missing `.map` files from custom builds) are skipped with a debug log instead of failing the upload, so existing prebuilt Workers keep deploying. An explicit `upload_source_maps = true` keeps the strict errors, and `false` / `--no-upload-source-maps` opts out. Also resolve Wrangler-bundled source map paths with `path.resolve`, as esbuild reports an absolute output path when `--outdir` is on a different Windows drive, which previously produced an invalid joined path.
32c878a to
fa5e9cf
Compare
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). Update the source maps and configuration docs to describe the new default, the lenient handling of unresolvable maps, and how to opt out, and add a changelog entry announcing it.
## pnpm-workspace.yaml (default) ## Dependency Updates | Package | From | To | Type | | --- | --- | --- | --- | | `wrangler` | 4.149.0 | 4.150.0 | minor | ## Release Notes <details> <summary><b>wrangler</b> (4.149.0 → 4.150.0)</summary> ### Minor Changes - [#16231](cloudflare/workers-sdk#16231) [`091e5ec`](cloudflare/workers-sdk@091e5ec) Thanks [@<!---->WalshyDev](https://github.com/WalshyDev)! - Upload source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` When `upload_source_maps` isn't set in config or via `--upload-source-maps`, Wrangler now generates and uploads source maps so stack traces in logs and `wrangler tail` point at your original source without extra setup. In this default mode, source maps that can't be resolved (for example inline `data:` maps or missing `.map` files from a custom build) are skipped rather than failing the upload. Setting `upload_source_maps = true` keeps the existing strict behaviour, and `upload_source_maps = false` (or `--no-upload-source-maps` for deploy and versions upload) opts out. `wrangler build --experimental-cf-build-output` is unchanged and still only includes source maps when `upload_source_maps = true`. - [#16128](cloudflare/workers-sdk#16128) [`daae435`](cloudflare/workers-sdk@daae435) Thanks [@<!---->redsteadz](https://github.com/redsteadz)! - Stop `wrangler deploy`, `wrangler versions upload` and `wrangler preview` in projects that build for the Cloudflare CLI (`cf`) If your project builds through `cf`, deploying it with Wrangler reads a different configuration, so it could update the wrong Worker or fail without explaining why. These commands now stop before uploading anything, name the `.cloudflare/output` directory they found, and tell you to run `cf deploy` instead. If that directory is just left over from an earlier build, deleting it restores the Wrangler workflow. Ordinary Wrangler projects are unaffected, and `--dry-run` still works on `deploy` and `versions upload`. This is a new guard for the experimental Build Output Specification rat …[full notes](https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.150.0) </details> --- *This PR was auto-generated by [catalog-update-action](https://github.com/brandhaug/catalog-update-action).* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
…34245) Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
Fixes #[insert GH or internal issue link(s)].
upload_source_mapsnow defaults to on forwrangler deploy,wrangler versions uploadandwrangler previewwhen it isn't set in config or via--upload-source-maps, so stack traces point at original source without extra setup.wrangler build --experimental-cf-build-outputkeeps its opt-in behaviour.When defaulted, source maps that can't be resolved (inline
data:maps, missing.mapfiles from custom builds) are skipped with a debug log instead of failing the upload, so existing prebuilt Workers keep deploying. An explicitupload_source_maps = truekeeps the strict errors, andfalse/--no-upload-source-mapsopts out.Also fixes Wrangler-bundled source map path resolution on Windows when
--outdiris on a different drive; esbuild reports an absolute path there, which was previously joined onto the entry directory.