Repository navigation
fix(sourcemaps): split web into eager chunks under the map cap, skip maps with no sources - #3031
Conversation
…maps with no sources The web index chunk's map was 37.5 MiB, over the 10 MiB upload cap, so the main bundle never symbolicated. Eager code-split groups (vendor, kit, app; up to 2.5 MB each, entry aware, strict execution order) keep every map under 4.5 MiB with nothing lazy-loaded. A prebuilt worker's map lists no sources; the server refused it and failed every prd deploy that built web. The uploader now skips such maps with a warning.
Maple review🟢 Confidence 8/10 · likely safe to merge. The uploader skip is pinned by a test and matches the server's rule; the bundle-layout change and the CLI copy of the rule are only covered by hand. Eager chunk splitting keeps every
Before merge
Findings🟠 Warning · F1 · New no-sources skip missing from
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| * Whether a plain map has no `mappings` string or no sources, which the server refuses. A prebuilt | ||
| * worker's map can list none. | ||
| */ | ||
| export const mapsNoSources = (mapText: string): boolean => |
There was a problem hiding this comment.
Warning
New no-sources skip missing from maple sourcemaps upload
F1 · Warning · maintainability
The upload rule now exists in two copies and only this PR's copy learned it. apps/cli/src/core/sourcemaps-upload.ts:174 still checks just isIndexMap, so the CLI keeps posting the elk worker's source-less map, the server's 400 becomes SourceMapUploadError, and the command exits ${n} source map upload(s) failed (apps/cli/src/commands/sourcemaps.ts:129).
Import `mapsNoSources` in `apps/cli/src/core/sourcemaps-upload.ts` and return a `skipped` outcome with the same reason beside its `isIndexMap` check, with a test case for a `sources: []` map.
🤖 Prompt to fix with an AI agent
In `packages/sourcemaps/src/inject.ts:170-178`: New no-sources skip missing from `maple sourcemaps upload`.
The upload rule now exists in two copies and only this PR's copy learned it. `apps/cli/src/core/sourcemaps-upload.ts:174` still checks just `isIndexMap`, so the CLI keeps posting the elk worker's source-less map, the server's 400 becomes `SourceMapUploadError`, and the command exits `${n} source map upload(s) failed` (`apps/cli/src/commands/sourcemaps.ts:129`).
Suggested fix: Import `mapsNoSources` in `apps/cli/src/core/sourcemaps-upload.ts` and return a `skipped` outcome with the same reason beside its `isIndexMap` check, with a test case for a `sources: []` map.
Verify the problem exists at that location before changing it, and keep the fix to those lines.
🍁 Maple PR previewNote Preview resources were removed when the preview label came off. Final commit |
|
Merged with 1 step from "Before merge" still open. If it is done, tick it on the review comment; if not, now is the time.
|
Why
Source maps are not working in prod yet:
websince the upload key landed (e21dbd, 9cdaa4, US and EU) ends red. Theweb-sourcemapsresource fails on a 400SourceMapInvalidError: the prebuilt elk worker's map lists no sources, which the server refuses. The Workers still deploy, but the run fails.indexchunk's map is 37.5 MiB, over the 10 MiB upload cap, so it is skipped. That is the chunk most dashboard stacks point at, so every prd symbolication so far endedmissing_map.What
apps/web/vite.config.ts: eager code-split groups (vendor,kit,app), up to 2.5 MB each. Nothing is lazy-loaded; every chunk is amodulepreload.entriesAwarekeepsbootoff the app's chunks, so the early Clerk start still loads only a 10 KB shared chunk.strictExecutionOrderkeeps module init order across the chunks. Without it the app threwj is not a functionat startup.mappingsstring or no sources is skipped with a warning, like the oversized and index maps already are, instead of failing the deploy.Evidence
Local production build of
apps/web:index)modulepreloadlinksLoad A/B: both builds served over local HTTP/2 with gzip, headless Chromium, external requests blocked, interleaved runs, median of 9. "Mounted" is when the boot shell is replaced by the sign-in page.
tsrstypecheck (web, alchemy-maple) and the effect oxlint config are clean.Still to check
The real upload and symbolication happen on the next prd deploy. This PR has no
preview:weblabel: previews have no upload key and do not upload. After merge, check the deploy log forUploaded N source map(s)and theStackSymbolicator.symbolicatespans formaple.stack.status.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit