Emscripten: Chrome produces this issue in the console:

Created on 2 Jan 2018  路  2Comments  路  Source: emscripten-core/emscripten

on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)
abort("on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)") at Error
at jsStackTrace (file:///C:/Users/John/Documents/Development/WebAssembly/hello/wasm2.js:1:13954)
at stackTrace (file:///C:/Users/John/Documents/Development/WebAssembly/hello/wasm2.js:1:14125)
at abort (file:///C:/Users/John/Documents/Development/WebAssembly/hello/wasm2.js:1:31908)
at getBinary (file:///C:/Users/John/Documents/Development/WebAssembly/hello/wasm2.js:1:20520)
at file:///C:/Users/John/Documents/Development/WebAssembly/hello/wasm2.js:1:20884
at
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.

On firefox, the code works properly. I am using the default template.

Most helpful comment

Run the html file as "emrun filename.html" from the terminal, it will automatically launch the file in localhost. "emrun" is a command from Emscripten.

All 2 comments

If someone else finds this issue...

Chrome displays this message for local files file:///home/user/WebAssembly-WebGL-2/build/index.html, load the file via a web server using http:// and it will be fine.

Run the html file as "emrun filename.html" from the terminal, it will automatically launch the file in localhost. "emrun" is a command from Emscripten.

Was this page helpful?
0 / 5 - 0 ratings