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

Merged
merged 4 commits into from
May 30, 2025

Conversation

notken12
Copy link
Contributor

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

@fs-eire
Copy link
Contributor

fs-eire commented May 26, 2025

It looks like the E2E tests are failing. please apply this change to fix it.

@notken12
Copy link
Contributor Author

@microsoft-github-policy-service agree

@fs-eire
Copy link
Contributor

fs-eire commented May 27, 2025

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows x64 QNN CI Pipeline

Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@fs-eire
Copy link
Contributor

fs-eire commented May 29, 2025

Could you please merge to latest main branch, which includes the CI pipeline fix?

@fs-eire
Copy link
Contributor

fs-eire commented May 29, 2025

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows x64 QNN CI Pipeline

Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@fs-eire fs-eire merged commit 9c18671 into microsoft:main May 30, 2025
82 checks passed
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