processing / p5.js-editor

Deprecated desktop editor for p5.js
https://p5js.org
MIT License
338 stars 91 forks source link

Editor crashing with 0.4.14 via CDN #172

Closed shiffman closed 8 years ago

shiffman commented 8 years ago

Not sure if it's 0.4.14 itself of the act of pulling from a CDN, but I opened an example with the following html and it crashes the editor (with empty setup() and draw()). Mac OS X, 0.5.2.

<html>
<head>
  <script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.14/p5.js"></script>
  <script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.14/addons/p5.dom.js"></script>
  <script language="javascript" type="text/javascript" src="sketch.js"></script>
</head>

<body>
</body>
</html>
shiffman commented 8 years ago

Update: crashes with CDN or with local libraries folder. Anyone else seeing this? @lmccart I put 0.4.14 in all of the ICM DOM examples so might need to revert unless it's just an issue on my laptop (will check another computer soon.) Also, I'm not using the recent serial releases which maybe I should?

lmccart commented 8 years ago

hey sorry about that, can you try with the latest version (0.4.15)?

shiffman commented 8 years ago

I'm still getting the crash with some examples (but not all). Here are three that are consistently crashing.

https://github.com/ITPNYU/ICM-2015/tree/master/07_dom/13_interface https://github.com/ITPNYU/ICM-2015/tree/master/07_dom/16_two_p5_canvases https://github.com/ITPNYU/ICM-2015/tree/master/07_dom/17_zombie_sliders

lmccart commented 8 years ago

hm it consistently works with 0.4.13 but not 0.4.14 or 0.4.15, but it's hard to track down with so little information... @antiboredom is there any way to get more debug info / crash log? run in the browser does work.

also, I tried building and running the editor from terminal and when I launch the app this way, the sketch runs fine with no crashing with any version of p5.js.

shiffman commented 8 years ago

(Aside I updated the ICM examples to run with 0.4.13 for now and alls well as you said.)

antiboredom commented 8 years ago

Strange - it's not crashing for me in the development environment....

antiboredom commented 8 years ago

@shiffman does it crash, by any chance in the latest beta version of the editor? http://saaaam.s3.amazonaws.com/p5-5.5-beta-mac.zip

lmccart commented 8 years ago

yeah, that's what i was seeing too. makes it super hard to track down the errors. i suppose i can revert all changes to the lib between 0.4.13 and 0.4.14 one by one, but if there's anyway to get a crash report log that would be really helpful.

shiffman commented 8 years ago

I was able to get it to crash with the latest beta 5.5, yes. It didn't on the first run, only after a few launches of the sketch (which was empty).

lmccart commented 8 years ago

ok i think i tracked it down. if you comment out this line, it's ok: https://github.com/processing/p5.js/blob/master/src/core/core.js#L181

still thinking about why...

lmccart commented 8 years ago

in the meantime, I think it'd be possible to do a hacky patch by adding a check to that if statement that disables the event adding if it's in the editor / node webkit. what's the best way to test whether we are running in the editor?

antiboredom commented 8 years ago

@lmccart not sure! But will investigate.

antiboredom commented 8 years ago

@lmccart try this for detecting nodewebkit:

https://gist.github.com/videlais/c426ff8d40d2ca35790f#file-detectnodewebkit-js