Skip to content

fix(neural): bundle onnxruntime-web in the deployed demo - #152

Merged
ronaldtse merged 1 commit into
mainfrom
fix-neural-ort-bundling
Sep 5, 2026
Merged

fix(neural): bundle onnxruntime-web in the deployed demo#152
ronaldtse merged 1 commit into
mainfrom
fix-neural-ort-bundling

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

The bug (caught by live verification, not assumed from merge)

The deployed /neural demo downloads the model fine, then dies: "Failed
to resolve module specifier 'onnxruntime-web'". Root cause in
astro.config.mjs: rolldownOptions.external listed onnxruntime-web —
added to silence unresolved-import noise from @litertjs/core (never
installed) — which left the lazy engine import as a bare runtime
specifier.

The fix

  • @litertjs/core installed as a real dependency (the diacritizer's
    engine, now resolvable)
  • external list reduced to onnxruntime-node (server-only, never
    imported by the client)
  • Verified in the built output: ort.bundle.min..js and the
    ort-wasm-
    .wasm binaries are now emitted

Verification

New opt-in live spec (LIVE_NEURAL=1, LIVE_NEURAL_BASE override):
downloads the real 95MB int4 artifact through the assets proxy and
asserts haraqat-bearing output. 1 passed (2.3m) against a local
preview of this build. Re-run against production after Pages rebuilds.

…d the ML engine

rolldownOptions.external listed onnxruntime-web (a build-noise
workaround for the uninstalled @litertjs/core), leaving a bare
specifier the browser cannot resolve: the deployed /neural demo failed
with 'Failed to resolve module specifier'. @litertjs/core is now a
real dependency and only the node-only backend stays external; the
ORT runtime and its wasm binaries bundle (ort.bundle.min.*.js +
ort-wasm-*.wasm in dist). New live e2e spec (LIVE_NEURAL=1) downloads
the real 95MB lite artifact and asserts vocalized output — passing
against a local preview.
@ronaldtse
ronaldtse merged commit e71b792 into main Sep 5, 2026
4 checks passed
@ronaldtse
ronaldtse deleted the fix-neural-ort-bundling branch September 5, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant