Repository navigation
fix: generate Worker source maps in framework templates - #1166
Open
irvinebroque wants to merge 1 commit into
Open
irvinebroque wants to merge 1 commit into
irvinebroque wants to merge 1 commit into
Conversation
This was referenced Oct 10, 2026
irvinebroque
marked this pull request as ready for review
October 10, 2026 18:45
kale-stew
reviewed
Nov 2, 2026
kale-stew
left a comment
Member
There was a problem hiding this comment.
This makes upload_source_maps: true actually do something for the Vite-plugin templates. Confirmed locally: react-starter writes dist/worker/index.js + .map outside the assets dir, and it still works with React Router 7.18.5 (#1181).
- CI is red on formatting: syncpack flags
package.jsonbecausecheck:source-mapsisn't in alphabetical order, so the new check has never run in CI. - Astro: after the build,
pages/*.astro.mjsand several chunks lose theirsourceMappingURLcomment, so the template's own code maps to build output rather thansrc/.check-source-mapsstill passes because it skips files without a comment and passes once any map is non-empty. Suggest failing when a.jshas a sibling.mapbut no comment, or when nothing undersrc/is mapped, and noting the Astro limitation like the Next.js README does. - I split the
saas-admin-template/public/.assetsignorechange out into #1183 (same contents) so it can land on its own; it'll drop out of this PR on rebase. check:source-mapsneeds a prior build; worth saying in CONTRIBUTING or running afterturbo run build.- Tests only cover the Vite-plugin layout; add the Astro and
build/serverpaths and the missing-comment case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generate external source maps for the Worker/server builds in the Vite, Remix, React Router, and Astro templates.
Add
templates check-source-mapsto the repository checks. It inspects built framework output for enabled uploads, valid external map references, mapped source, and exclusion of server maps from public assets. Document the build contract for future templates.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.
Checklist
Existing templates are updated; template metadata is unchanged. The metadata checklist below is retained from the repository template.
-templatepackage.jsonis populated<!-- dash-content-start -->and<!-- dash-content-end -->to designate the Dash readme preview.gitignorefile existspackage.jsoncontains adeploycommandpackage.jsoncontainsprivate: trueand noversionfield