pyodide: Maximum call stack error when running pyodide within a web worker

System combinations that were tested, and confirmed bug occured:

  • Ubuntu 19.04
  • Firefox Quantum 67.0 (64-bit)
  • Chrome Version 74.0.3729.157 (Official Build) (64-bit)

Description of Bug

This issue appears to have been introduced when running Pyodide within a webworker.

Firefox

On Firefox I get the following error message:

image

Weirdly on Firefox on first page load it doesn’t appear to occur, but after running a plain refresh F5 this error message does occur.

Chrome

On Chrome I get the following error message:

image

How issue was introduced

It occurs by including the line ctx.pyodide.runPython('import matplotlib') at the following location:

https://github.com/pymedphys/pymedphys/blob/f6bdf5ce9e8858714d9f6c0fa629ce34d91e067b/app/src/observables/webworker-messaging/pyodide.worker#L39-L50

Demo of app causing issue

See a live version of this commit over at https://5ce927378b870500077d8c9c--app-pymedphys.netlify.com/

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 17 (15 by maintainers)

Most upvoted comments

For me, Pyodide worker works in Chrome and Firefox (for both Windows 10/Mac 10.14), but I haven’t tried loading any heavy packages. In Safari, I get a maximum call stack error as soon as I try to initialize Pyodide in a worker.

image

I’m switching back to a non-worker solution… 😞

Thanks @SimonBiggs for reporting this issue.