pyodide: TypeError: getWasmTableEntry(...) is not a function

πŸ› Bug

pyodide.asm.js:10 Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
pyodide.asm.js:10 The cause of the fatal error was:
pyodide.asm.js:10 TypeError: getWasmTableEntry(...) is not a function
    at invoke_ii (pyodide.asm.js:10:1544237)
    at 00bcba5a:0x54516
    at invoke_viiiiiiiiiiiiiii (pyodide.asm.js:10:1548668)
    at 00bcba5a:0x414a2
    at invoke_viii (pyodide.asm.js:10:1545014)
    at 00bcba5a:0x56286
    at method_call_trampoline (pyodide.asm.js:10:216572)
    at pyodide.asm.wasm:0x162162
    at method_call_trampoline (pyodide.asm.js:10:216572)
    at pyodide.asm.wasm:0x126317
API.fatal_error @ pyodide.asm.js:10
Module.callPyObjectKwargs @ pyodide.asm.js:10
Module.callPyObject @ pyodide.asm.js:10
apply @ pyodide.asm.js:10
apply @ pyodide.asm.js:10
runPython @ pyodide.asm.js:10
main @ (index):15
await in main (async)
(anonymous) @ (index):22
pyodide.asm.js:10 Stack (most recent call first):
pyodide.asm.js:10   File "<exec>", line 5 in <module>
pyodide.asm.js:10   File "/lib/python3.10/site-packages/_pyodide/_base.py", line 304 in run
pyodide.asm.js:10   File "/lib/python3.10/site-packages/_pyodide/_base.py", line 435 in eval_code
(index):21 Uncaught (in promise) TypeError: getWasmTableEntry(...) is not a function
    at invoke_ii (pyodide.asm.js:10:1544237)
    at 00bcba5a:0x54516
    at invoke_viiiiiiiiiiiiiii (pyodide.asm.js:10:1548668)
    at 00bcba5a:0x414a2
    at invoke_viii (pyodide.asm.js:10:1545014)
    at 00bcba5a:0x56286
    at method_call_trampoline (pyodide.asm.js:10:216572)
    at pyodide.asm.wasm:0x162162
    at method_call_trampoline (pyodide.asm.js:10:216572)
    at pyodide.asm.wasm:0x126317

To Reproduce

https://github.com/kitao/pyxel/tree/maturin

  • First install the maturin beta version: pip install -U --pre maturin
  • Build with maturin: RUSTUP_TOOLCHAIN=nightly maturin build -o dist --release --target wasm32-unknown-emscripten
  • Run ./scripts/start_server and open http://localhost:8000 in browser, see the error in console.

Expected behavior

No TypeError: getWasmTableEntry(...) is not a function in console.

Environment

  • Pyodide Version: 0.21.0
  • Browser version: 104.0.5112.79
  • Any other relevant information:

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (14 by maintainers)

Most upvoted comments

I rebuilt pyodide with -sUSE_SDL=2, then the message changed: image

I assumed this is related to a canvas issue(https://github.com/emscripten-ports/SDL2/issues/130), so I added a blank canvas with id β€œcanvas”:

<!-- Bootstrap HTML for running the unit tests. -->
<!DOCTYPE html>
<html>
  <head>
    <title>pyodide</title>
    <script src="./pyodide.js"></script>
  </head>
  <body>
    <canvas id="canvas"></canvas>
    <script type="text/javascript">
      async function main(){
        const pyodide = await loadPyodide();
        await pyodide.loadPackage("micropip")
        const micropip = pyodide.pyimport("micropip")
        await micropip.install("pyxel-1.8.0-cp37-abi3-emscripten_3_1_14_wasm32.whl")
        await pyodide.runPython(`
                import pyxel
                pyxel.init(600,480)
        `)
      }
      main()
    </script>
  </body>
</html>

Then the error changed: image

Although it crashes, the initial linking issue seems to be resolved.