Repository navigation
fix(app): bundle onnxruntime-web into the TTS worker - #71
Conversation
Marking onnxruntime-web external left a bare import "onnxruntime-web" in the built Kokoro worker, which a browser cannot resolve, so High-quality TTS failed to load in production. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. WalkthroughThe Vite configuration removes the Merge Risk:
|
|
Maintainer decision (via /quest-run): ✅ (Written by Claude Opus 5.5) |
Problem
app/vite.config.tsmarkedonnxruntime-webexternal for both the app and worker builds. Nothing maps that bare specifier at runtime, so the built Kokoro TTS worker starts withimport*as e from"onnxruntime-web"and fails to load: High-quality TTS is broken in production. Found while working on #65 (closed), whose closing comment asked for this fix to land separately.Approach
Drop the
externalfrombuild.rolldownOptionsandworker.rolldownOptions, so Vite bundles ORT's JS into the lazy TTS worker. transformers.js still points ORT at its jsdelivr WASM by default, as before.Impact
indexchunk: unchanged (1,218,156 bytes before and after).dist/gains a 21.6 MBort-wasm-simd-threaded.jsep.wasmasset (5.2 MB gzip), under Cloudflare's 25 MiB per-file limit. Not fetched by the initial page; dropping it needs a custom plugin, not worth it while the TTS quest (quest/m2/tts-phonon.md, planned in quest: plan captions from moq.pro transcripts and TTS on Phonon #72) removes ORT from TTS.Caused by
No single PR: the external came from direct commits to
mainin 2025 (f8a3bf0"Don't bundle all of ONNX.",a825fa5"Avoid bundling the ORT WASM blob too.").Validation
quest gate just buildonmain: the builtworker-*.jscontainsimport*as e from"onnxruntime-web". With the fix, no chunk has a bareonnxruntime-webimport.dist/builds and constructed the built TTS worker as a module worker in Chrome (agent-browser).main's worker fired anerrorevent (script failed to load); the fixed worker loaded with no error.quest gate just checkpasses.main(8802dca): CICheck(just check && just build, includingtest:media) passes. Locally,quest gate just checkpassed everything up totest:media, whose browser tests timed out at a host load average of ~27; a rerun timed out in its setup hook. The change only touches production build options, which the Vite dev server those tests run on does not read.mainagain (69b7aa8, conflict-free, picks up quest: audit the quest tree #58 and feat(room): live MoQ telemetry HUD in Debug mode #64):quest gate just buildpasses and still emitsort-wasm-simd-threaded.jsep-*.wasm; CICheckpasses. Locallytest:mediaagain timed out under host load (~25 on 2 CPUs), as above.Models
Size: XS
Implementer: Claude Code, claude-opus-5-5, medium
Implementer: Claude Code, claude-opus-5-5, medium effort (iterate, XS)
Implementer: Claude Code, claude-opus-5-5, medium effort (iterate, XS)
(Written by Claude Opus 5.5 with medium)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 8802dca
Base: origin/main at 51647b2
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Risk file: none
Reviewer: Codex, gpt-6.2-sol, low effort
Session:
01a219d4-9a6f-79d2-ad01-47daeaaad558, round 1Score: 9/10,
Bundling ONNX Runtime makes the dependency resolvable in the production TTS worker while preserving lazy loading, with only stale planning references remaining.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
Notes, the author's to take or leave:
app/vite.config.ts:24:Remove stale references to the ONNX Runtime workaround