BTW, if you want to get things working quickly you should be able use
`-sSINGLE_FILE_BINARY_ENCODE=0`.  This setting was added specifically in
case a bug this showed up/

cheers,
sam

On Fri, Oct 31, 2025 at 8:54 AM Thomas Grund <[email protected]>
wrote:

> Thanks for analyzing!
>
> Thomas
>
> [email protected] schrieb am Donnerstag, 30. Oktober 2025 um 18:32:45
> UTC+1:
>
>> Thanks for reporting, this turns out ot be a recent regression in
>> SINGLE_FILE. I bisected to
>>
>> https://github.com/emscripten-core/emscripten/pull/25599
>>
>> and posted there.
>>
>> - Alon
>>
>>
>> On Thu, Oct 30, 2025 at 6:02 AM Thomas Grund <[email protected]>
>> wrote:
>>
>>> Hello,
>>>
>>> The following example does
>>>
>>>    -  not work with current emcc 4.0.18 in Chrome.
>>>
>>> It
>>>
>>>    - works with current emcc 4.0.18 in Firefox and it
>>>    - works with emcc 4.0.16 in Chrome.
>>>
>>> I use local files on Windows 11.
>>>
>>> Example index.html:
>>> <!DOCTYPE html>
>>> <html>
>>> <head>
>>> <script>
>>> function compute() {
>>> a=parseFloat(document.getElementById('a').value);
>>> b=parseFloat(document.getElementById('b').value);
>>> document.getElementById('c').innerText = Module.Sum(a, b);
>>> }
>>> </script>
>>> <script src="Sum.js"></script>
>>> </head>
>>> <body>
>>> <input id="a" type="number" onchange="compute()">
>>> <input id="b" type="number" onchange="compute()">
>>> <div id="c">Result</div>
>>> </body>
>>> </html>
>>>
>>> Example Sum.cpp:
>>> #include <emscripten/bind.h>
>>>
>>> double Sum(double a, double b) {
>>>    return a+b;
>>> }
>>>
>>> EMSCRIPTEN_BINDINGS(Module) {
>>>    emscripten::function("Sum", &Sum);
>>> }
>>>
>>> Compile with:
>>> emcc -o Sum.js Sum.cpp -sSINGLE_FILE --bind -sASSERTIONS
>>>
>>> Error in Chrome Console:
>>> failed to asynchronously prepare wasm: CompileError:
>>> WebAssembly.instantiate(): section was shorter than expected size (18371
>>> bytes expected, 207 decoded) @+219
>>> instantiateArrayBuffer @ Sum.js:634
>>> await in instantiateArrayBuffer
>>> instantiateAsync @ Sum.js:645
>>> createWasm @ Sum.js:713
>>> (anonymous) @ Sum.js:2761Understand this error
>>> Sum.js:275 Uncaught (in promise) TypeError: filename.startsWith is not a
>>> function
>>> isFileURI @ Sum.js:275
>>> instantiateArrayBuffer @ Sum.js:637
>>> await in instantiateArrayBuffer
>>> instantiateAsync @ Sum.js:645
>>> createWasm @ Sum.js:713
>>> (anonymous) @ Sum.js:2761Understand this error
>>> Sum.js:794 still waiting on run dependencies:
>>> (anonymous) @ Sum.js:794
>>> setInterval
>>> addRunDependency @ Sum.js:784
>>> createWasm @ Sum.js:674
>>> (anonymous) @ Sum.js:2761Understand this error
>>> Sum.js:796 dependency: wasm-instantiate
>>> (anonymous) @ Sum.js:796
>>> setInterval
>>> addRunDependency @ Sum.js:784
>>> createWasm @ Sum.js:674
>>> (anonymous) @ Sum.js:2761Understand this error
>>> Sum.js:799 (end of list)
>>> (anonymous) @ Sum.js:799
>>> setInterval
>>> addRunDependency @ Sum.js:784
>>> createWasm @ Sum.js:674
>>> (anonymous) @ Sum.js:2761Understand this error
>>>
>>> What am I doing wrong?
>>>
>>> Thanks for your help!
>>> Thomas
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "emscripten-discuss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion visit
>>> https://groups.google.com/d/msgid/emscripten-discuss/504419d6-cdcf-4eec-9a1e-e7f69f87a129n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/emscripten-discuss/504419d6-cdcf-4eec-9a1e-e7f69f87a129n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/emscripten-discuss/5b591cef-ad8e-467f-95dc-b43719e21086n%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/5b591cef-ad8e-467f-95dc-b43719e21086n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28rOKEOnYUfSs%2BJL4Do4RZ9PWQnJ7c17Yd0DSOZeBQK6Q%40mail.gmail.com.

Reply via email to