fix(neural): bundle onnxruntime-web in the deployed demo - #152
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.externallisted 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
engine, now resolvable)
imported by the client)
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.