Every Tauri build since 0.11.20 logs a source map parse error per chunk in the
webview console:
Source Map "tauri://localhost/_next/static/chunks/<hash>.js.map" has
SyntaxError: JSON Parse error: Unrecognized token '<'
productionBrowserSourceMaps makes Turbopack emit the maps and append a
sourceMappingURL comment to every chunk. upload-sourcemaps.mjs uploads the maps
to Sentry and deletes them, but left the comments behind, so devtools requested
the missing maps (204 of 210 chunks) and got the asset protocol's HTML back.
- upload-sourcemaps.mjs: strip the comment alongside the map. Turbopack names a
map after a different hash than the chunk pointing at it, so every chunk under
the directory is rewritten rather than paired by name. The sentry-cli debugId
comment is preserved, since Sentry matches uploaded maps by it.
- KEEP_SOURCEMAPS=1 keeps the maps in the bundle instead. dev-ios, dev-android
and the new dev-macos set it, so local devtools resolve minified frames to
real sources.
- Move the script body behind a main guard so the helpers are importable, and
unit test them.
Symbolication is unaffected: the strip still runs after the upload, so the
copies Sentry holds keep their comments.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Production JS crashes report minified chunk names with no source lines, which
blocked triaging most reader/TTS Sentry issues. Generate browser source maps for
the Tauri export build and upload them right after `next build`:
- next.config: productionBrowserSourceMaps for the export build.
- scripts/upload-sourcemaps.mjs: sentry-cli injects debug IDs + uploads the maps
(release Readest@<version>, ~/_next/static url-prefix), then strips the .map
files so they never ship in the app bundle. Token-gated; never fails the build.
- CI (release.yml, nightly.yml): pass SENTRY_AUTH_TOKEN / SENTRY_ORG /
SENTRY_PROJECT alongside SENTRY_DSN.
- docs/sentry-symbolication.md: setup + required secret, and the native
(Android ProGuard/.so, iOS dSYM) follow-up.
Local and fork builds are unaffected: with no token the maps are stripped and
the output is unchanged. Needs the SENTRY_AUTH_TOKEN GitHub secret to take effect.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>