倉庫指標
- Star
- (27,361 star)
- PR 合併指標
- (平均合併 19天 10小時) (30 天內合併 147 個 PR)
描述
Dear all,
I experience problems using the Fetch API together with WebAssembly modules.
Firstly, I copy/paste the exact sample code from the Introduction section of the Fetch API, and put it inside a file called test.c.
Secondly, I create a basic index.html as follows:
<html>
<body>
<h1>Test</h1>
<script async type="text/javascript" src="test.js"></script>
</body>
</html>
Finally, I compile the WebAssembly binaries (version 1.39.17 of Emscripten), and serve them using Python as follows:
export FLAGS="-s MAIN_MODULE=1 -s EXPORT_ALL=1 -s FETCH=1 -s WASM=1"
~/Downloads/emsdk/upstream/emscripten/emcc ${FLAGS} -DNDEBUG -O2 -o test.o -c test.c
~/Downloads/emsdk/upstream/emscripten/emcc ${FLAGS} -DNDEBUG -O2 test.o -o test.js
python -m SimpleHTTPServer 8000
When I open http://localhost:8000/, I get the following errors in the console:
Maximum call stack size exceededon Chromium, andInternalError: too much recursion,__emscripten_fetch_load_cached_dataon Firefox.
The problem disappears if I don't use modules (i.e. if I remove -s MAIN_MODULE=1). Would the Fetch API be incompatible with WebAssembly modules? Is there a way to solve this issue?
Thanks for your great work on Emscripten!