Skip to content

Commit a5195d9

Browse files
committed
fix(onnx): remove ES module type from onnxruntime package.json
The ONNX Runtime build system generates wasm_post_build.js which uses CommonJS require() syntax. When package.json has "type": "module", Node.js tries to run this generated file as an ES module, causing: ReferenceError: require is not defined in ES module scope Solution: Remove "type": "module" from package.json. The build scripts (build.mjs, clean.mjs) are already .mjs files so they'll run as ES modules, while the generated post-build scripts will run as CommonJS. Fixes ONNX Runtime WASM build failure.
1 parent c4f6c12 commit a5195d9

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

packages/onnxruntime/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "@socketsecurity/onnxruntime",
33
"version": "1.21.1",
44
"description": "Custom ONNX Runtime WASM build optimized for Socket CLI",
5-
"type": "module",
65
"private": true,
76
"exports": {
87
"./build/wasm/ort-wasm-simd-threaded.js": "./build/wasm/ort-wasm-simd-threaded.js",

0 commit comments

Comments
 (0)