Fix inference unable to run due to JS WASM runtime not being bundled into onnxruntime-web/wasm build#24836
Merged
Merged
Conversation
…dle.min.mjs` as it is for other `bundle.min.mjs` builds
Contributor
|
need format code |
Contributor
|
It looks like the E2E tests are failing. please apply this change to fix it. |
Contributor
Author
|
@microsoft-github-policy-service agree |
fs-eire
approved these changes
May 27, 2025
Contributor
|
/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 |
|
Azure Pipelines successfully started running 5 pipeline(s). |
Contributor
|
Could you please merge to latest main branch, which includes the CI pipeline fix? |
Contributor
|
/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 |
|
Azure Pipelines successfully started running 5 pipeline(s). |
ankus-qti
pushed a commit
to CodeLinaro/onnxruntime
that referenced
this pull request
Nov 25, 2025
…into `onnxruntime-web/wasm` build (microsoft#24836) ### 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](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js/importing_onnxruntime-web#conditional-importing) and imported the WASM-only build: ```diff - 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.
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.
Description
Fixes inference error from
ort-wasm-simd-threaded.mjsnot being bundled intoort.wasm.bundle.min.mjsas it is for otherbundle.min.mjsbuilds.Motivation and Context
To decrease my app's bundle size, I followed the conditional importing guide and imported the WASM-only build:
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.mjswas not bundled into the build atonnxruntime-web/wasm, which points toort.wasm.bundle.min.mjs, despite how its name suggests. In other builds withbundlein 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.