You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggested fix:
Wait till p5 initialization is complete before continuing setup. Not sure what the best approach is, since I don't see a "run_js_async" equivalent to "run_js". Maybe having some sort of callback that continues the python setup after p5 initialization.
The text was updated successfully, but these errors were encountered:
I ran into an error when initialzing p5 with
Sketch()
pyodide.ffi.JsException: TypeError: defaultCanvas0.canvas is undefined
It comes from
binding.py
attempting to access the canvas on the p5 instance that was just initiated can sometimes fail if p5 takes a bit too long to initialize.
I ran into this when also importing p5 sound
I think the addon might make p5 take longer than normal and exposes this problem.
Reproduction:
Starting from the starter template, load the p5js sound library, see crash on init.
example repo:
https://johnc14231.pyscriptapps.com/proceso-starter-copy-54206/
Suggested fix:
Wait till p5 initialization is complete before continuing setup. Not sure what the best approach is, since I don't see a "run_js_async" equivalent to "run_js". Maybe having some sort of callback that continues the python setup after p5 initialization.
The text was updated successfully, but these errors were encountered: