-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I'm interested in running some code that uses wasm, but when running the benchmarks, it throws compile errors. For example:
Uncaught CompileError: WebAssembly.instantiateStreaming(): section (code 1, "Type") extends past end of the module (length 9396207, remaining bytes 1347243) @+8
Looking at the network tab and downloading the wasm binary from there, it is different than the file that is located in node_modules, so it seems like its being modified somewhere.
Here is a small test case
index.html
<script type="module">
import * as bench from '/bench.js';
const brotli = await import("brotli-wasm/index.web.js").then(m => m.default);
const textEncoder = new TextEncoder();
const input = 'some input';
const uncompressedData = textEncoder.encode(input);
bench.start();
const compressedData = brotli.compress(uncompressedData);
bench.stop();
</script>
package.json
{
"name": "tachometer-wasm",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {},
"author": "",
"license": "ISC",
"dependencies": {
"brotli-wasm": "^3.0.1"
}
}
Reproduction steps:
- run tachometer ./index.html
Expected results:
- No errors and benchmark should run
Actual:
- there is a CompileError thrown and the file
brotli_wasm_bg.wasmfetched by the browser differs from the file innode_modules\brotli-wasm\pkg.web\brotli_wasm_bg.wasm
Metadata
Metadata
Assignees
Labels
No labels