Skip to content

Fix inference unable to run due to JS WASM runtime not being bundled into onnxruntime-web/wasm build #24836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

notken12
Copy link

Description

Fixes inference error from ort-wasm-simd-threaded.mjs not being bundled into ort.wasm.bundle.min.mjs as it is for other bundle.min.mjs builds.

Motivation and Context

To decrease my app's bundle size, I followed the conditional importing guide and imported the WASM-only build:

- import * as ort from 'onnxruntime-web';
+ import * as ort from 'onnxruntime-web/wasm';

After this change, creating an inference session would result in: TypeError: Failed to resolve module specifier './ort-wasm-simd-threaded.mjs'.

This was because ort-wasm-simd-threaded.mjs was not bundled into the build at onnxruntime-web/wasm, which points to ort.wasm.bundle.min.mjs, despite how its name suggests. In other builds with bundle in their name, the module is bundled, yet it was not done so in the WASM one. This PR bundles the Javascript WASM runtime in to match the other builds, fixing the error.

…dle.min.mjs` as it is for other `bundle.min.mjs` builds
@fs-eire
Copy link
Contributor

fs-eire commented May 22, 2025

need format code

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.

2 participants