fix: downgrade onnxruntime-web to 1.18 for non-threaded SIMD WASM

ort 1.19+ dropped non-threaded WASM binaries and replaced them with a
threaded .mjs loader that Vite's dev server fails to serve correctly
(wrong MIME type / transform interception). ort 1.18 ships ort-wasm-simd.wasm
which works with numThreads=1 and needs no .mjs dynamic import.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mk
2026-03-23 23:45:05 -03:00
parent b25cec3aa0
commit f2988cd689
4 changed files with 33 additions and 7 deletions

View File

@@ -148,6 +148,7 @@
},
"packageManager": "yarn@4.7.0",
"dependencies": {
"@ricky0123/vad-web": "^0.0.30"
"@ricky0123/vad-web": "^0.0.30",
"onnxruntime-web": "1.18.0"
}
}

View File

@@ -6,8 +6,8 @@ Please see LICENSE in the repository root for full details.
*/
import { MicVAD, getDefaultRealTimeVADOptions } from "@ricky0123/vad-web";
// ort is not re-exported from the index, import from submodule
import { ort } from "@ricky0123/vad-web/dist/real-time-vad";
// ort is not re-exported from the vad-web index; import from the submodule
import { ort } from "@ricky0123/vad-web/dist/real-time-vad.js";
import { logger } from "matrix-js-sdk/lib/logger";
const log = logger.getChild("[SileroVADGate]");

View File

@@ -50,10 +50,6 @@ export default ({
src: "node_modules/onnxruntime-web/dist/*.wasm",
dest: "vad",
},
{
src: "node_modules/onnxruntime-web/dist/ort-wasm-simd-threaded.mjs",
dest: "vad",
},
],
}),
react(),

View File

@@ -8450,6 +8450,7 @@ __metadata:
node-stdlib-browser: "npm:^1.3.1"
normalize.css: "npm:^8.0.1"
observable-hooks: "npm:^4.2.3"
onnxruntime-web: "npm:1.18.0"
pako: "npm:^2.0.4"
postcss: "npm:^8.4.41"
postcss-preset-env: "npm:^10.0.0"
@@ -9635,6 +9636,13 @@ __metadata:
languageName: node
linkType: hard
"flatbuffers@npm:^1.12.0":
version: 1.12.0
resolution: "flatbuffers@npm:1.12.0"
checksum: 10c0/14f9fb55f3063b389fc4e3d67ee8ffc71e351b478369fdae919701e458fc7766f2fea4f51181d6e73b4930fbc018cb7013558930367811b960cff01f23aae618
languageName: node
linkType: hard
"flatbuffers@npm:^25.1.24":
version: 25.9.23
resolution: "flatbuffers@npm:25.9.23"
@@ -12046,6 +12054,13 @@ __metadata:
languageName: node
linkType: hard
"onnxruntime-common@npm:1.18.0":
version: 1.18.0
resolution: "onnxruntime-common@npm:1.18.0"
checksum: 10c0/dc5caab4c5b95b4255ba3dcd5ea3e04e10a3a8c605d60c53dac25facfbe9d59a60c510b8ffc3e5f1c8816fded479b6f946b7840a0d10cbd32914ef8ce81c7218
languageName: node
linkType: hard
"onnxruntime-common@npm:1.24.3":
version: 1.24.3
resolution: "onnxruntime-common@npm:1.24.3"
@@ -12053,6 +12068,20 @@ __metadata:
languageName: node
linkType: hard
"onnxruntime-web@npm:1.18.0":
version: 1.18.0
resolution: "onnxruntime-web@npm:1.18.0"
dependencies:
flatbuffers: "npm:^1.12.0"
guid-typescript: "npm:^1.0.9"
long: "npm:^5.2.3"
onnxruntime-common: "npm:1.18.0"
platform: "npm:^1.3.6"
protobufjs: "npm:^7.2.4"
checksum: 10c0/90d9eed3e8d8bcfea61858eee2a1b94c680c67f6265bb5924752ae1bd9db93cb2dd8bc562ffba6b048fc32c721fcc30fd0b0669da5607fc6c41eaecaba3d4bd7
languageName: node
linkType: hard
"onnxruntime-web@npm:^1.17.0":
version: 1.24.3
resolution: "onnxruntime-web@npm:1.24.3"