Skip to content

feat(web): source-mapped stack trace on the error issue page - #3022

Merged
Makisuo merged 22 commits into
sourcemaps/cli-sdkfrom
sourcemaps/ui
Nov 24, 2026
Merged

Makisuo merged 22 commits into
sourcemaps/cli-sdkfrom
sourcemaps/ui

feat(alchemy): Vite plugin and Maple.SourceMaps resource, upload web'…

303dc1c
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Nov 24, 2026 in 8m 32s

Confidence 9/10 · No issues found

🟢 Confidence 9/10 · safe to merge. The upload/inject paths are single-sourced, bounded and pinned by new unit and scene tests; only the .map relocation boundary deserves a second look.
no findings · tests covered · risk medium · 1/3 new units observable −1

Adds the source-map pipeline (shared @maple/sourcemaps inject/relocate, an alchemy Maple.SourceMaps resource plus Vite plugin, prd-only upload key) and the source-mapped stack trace on the error issue page. Path escapes, the size limit and the toggle state are all handled; nothing blocks merge.

  • injectDirectory/relocateMaps share the CLI and Vite build path and refuse maps escaping the output
  • Maple.SourceMaps uploads only when the digest changes and never retries a POST
  • stackFrameList folds library runs and opens the top in-app frame's code
  • withDetail resets flipped rows and the Raw toggle when the stack identity changes

Before merge

  • Secret · Create MAPLE_SOURCEMAPS_API_KEY in the Infisical prod environment (a source_maps:write key); keep it out of dev and preview. · packages/infra/src/secrets.ts:163
  • Infra · Check every environment has what this config now expects · alchemy.run.ts
  • Manual · Run bun run secrets:drift after adding the key to the catalog.

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day
packages/alchemy-maple/src/MapleApi.ts 4.6k
packages/infra/src/secrets.ts 4.3k
apps/web/vite.config.ts 178
packages/alchemy-maple/src/Vite.ts 77
What was checked
  • Map reads stay inside the build dir: isInside checks lexically and after realPath (inject.ts:211)
  • upload goes through request, so POST is not retried (MapleApi.ts:149, :228); one SOURCE_MAP_MAX_BYTES source (packages/domain/src/http/source-maps.ts:5)
  • @maple/sourcemaps exports . and ./limits, mapped in tsconfig.alchemy-maple.json:14; exceptionPanel renders once, so issue-stack ids stay unique (view.ts:237)
Observability coverage: 1 of 3 changes observable
Change Kind Observable Evidence
Maple.SourceMaps provider upload to POST /v2/source_maps outbound call yes Goes through MapleApi.request, wrapped in the existing Effect.fn("MapleApi.requestAttempt") span (MapleApi.ts:143)
mapleSourceMaps Vite closeBundle step build step no Reports through this.info(...) in the Vite logger (Vite.ts:108); runs in the build, not a service
web deploy's own source-map upload (uploadWebSourceMaps) deploy step no Effect.logInfo/logWarning in the provider (SourceMaps.ts:238, :284); a no-op without the prd-only key

303dc1c · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.