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
no p5 functions work outside of setup/draw... if you can think of any good way to catch this error it'd be wonderful, but I haven't come up with anything yet. the main issue is that calling p5 functions before setup fails because p5 hasn't been instantiated yet (this non-automatic global binding of p5 functions is in place to support instance mode, where p5 is wrapped up in one object so as not to pollute the global namespace. so we have to wait to be sure we are working in global mode before adding all the p5 functions). so i'm not how we could catch errors when p5 isn't running? but any thoughts welcome!
It's a bit hacky, but what if we added an onerror event handler that caught errors during page load and offered help if possible?
hmm, interesting... I can't think of any major downsides to giving it a shot? if it seems to cause more confusion than it's worth we can always remove it.
toolness
added a commit
to toolness/p5.js
that referenced
this issue
Nov 26, 2015
(This is basically a re-post of #1106 (comment), which was a comment in a closed issue that might have gone unnoticed.)
@lmccart wrote:
It's a bit hacky, but what if we added an
onerror
event handler that caught errors during page load and offered help if possible?Here's an example: http://jsbin.com/riyaco/2/edit?html,console,output
Again, it's hacky, and I'm not sure how many false positives it'd trigger...
The text was updated successfully, but these errors were encountered: