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
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
consoleEvents:
[
{
"method": "error",
"data": [],
"id": "1689445824835"
},
{
"method": "log",
"id": "d50aa29a-d7d5-0e4d-93e5-f203-1689445824617",
"data": [
"\n🌸 p5.js says: [sketch.js, line 2] It seems that you may have accidentally written \"createCanvs\" instead of \"createCanvas\". Please correct it to createCanvas if you wish to use the function from p5.js. (http://p5js.org/reference/#/p5/createCanvas)"
]
}
]
In my testing, changing Editor.jsx line 270 from checking consoleEvent.method === 'error' to consoleEvent.method == 'error' && consoleEvent.data.length > 0 seems to solve the issue. Not sure if that breaks other functionality.
This might be caused by changes to the friendly error system that were pushed as part of the latest release over at the p5.js repo - maybe they changed the error objects? Not sure, just a guess.
Using 1.6.0 libraries in the sketch didn't resolve the error
We did not change this line. But somehow the consoleEvent.data[0] variable is undefined whereas it was defined before.
I suspect this is related to bumping the version of the console-feed package. But I'll dig in further and see why the data structures changed.
Somehow the error is coming through as two separate console events when it should be one. The first has method: "error" and no data, which causes the crash. The data that we are expecting is attached to a second message with method: "log".
This is the change on their end which is causing problems for us:
Sometimes we do have that __console_feed_remaining__0 at the end of the data array and Decode is doing what's intended by dropping it. Other times we don't have that additional entry and the .pop() is causing the actual data to get dropped.
I'm not sure at this point why we do have it on the p5 friendly error and not on the runtime error. So that's something I can look into. I can also put in a PR to console-feed to add additional checks before dropping entries from data. But definitely the quickest fix is to downgrade to a version that works.
Thanks so much @JasonGoemaat@wong-justin@lindapaiste for working together to resolve this! I'm really sorry that this happened due to my major oversight in upgrading the console-feed package 😭
I just pushed out a new release with the changes, and tweaked @wong-justin's PR afterwards to include the updates to the lockfile as well. It seems to be working for me for now, but please let me know if this persists. Sorry again about this!
Activity
welcome commentedon Jul 15, 2023
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.
wong-justin commentedon Jul 15, 2023
I'm getting lots of page crashes too. Minimal example, no shaders: https://editor.p5js.org/jwong/sketches/SaB4RgMl4
And this seems to have started happening since yesterday's editor release.
The error message from Firefox:
Screenshot of error from a Chrome-based browser:

And just noticed #2296 , same issue
wong-justin commentedon Jul 15, 2023
Here's some more logs from the error:
In my testing, changing Editor.jsx line 270 from checking
consoleEvent.method === 'error'toconsoleEvent.method == 'error' && consoleEvent.data.length > 0seems to solve the issue. Not sure if that breaks other functionality.This might be caused by changes to the friendly error system that were pushed as part of the latest release over at the
p5.jsrepo - maybe they changed the error objects? Not sure, just a guess.Using
1.6.0libraries in the sketch didn't resolve the errorlindapaiste commentedon Jul 15, 2023
Thanks everyone for reporting this! I am looking into it now. The error is thrown from
Editorline 273:p5.js-web-editor/client/modules/IDE/components/Editor.jsx
Line 273 in 4161f98
We did not change this line. But somehow the
consoleEvent.data[0]variable isundefinedwhereas it was defined before.I suspect this is related to bumping the version of the
console-feedpackage. But I'll dig in further and see why the data structures changed.Somehow the error is coming through as two separate console events when it should be one. The first has

method: "error"and nodata, which causes the crash. Thedatathat we are expecting is attached to a second message withmethod: "log".wong-justin commentedon Jul 15, 2023
Downgrading
console-feedpackage to3.2.0seems to fix it. Theevent.datais populated again.lindapaiste commentedon Jul 15, 2023
@wong-justin Yeah I think that's going to be the best solution. You can put in a PR with the downgrade, if you want to.
Pinging @raclim -- this seems pretty serious. Can we put out a new release quickly?
Something changed in
console-feed'sDecodefunction and it's causing thedatato get stripped out when the event is decoded.p5.js-web-editor/client/modules/IDE/hooks/useHandleMessageEvent.js
Line 12 in 4161f98
This is the
messagesbefore callingDecode:and this is the
decodedMessages:This is the change on their end which is causing problems for us:

Sometimes we do have that
__console_feed_remaining__0at the end of thedataarray andDecodeis doing what's intended by dropping it. Other times we don't have that additional entry and the.pop()is causing the actual data to get dropped.I'm not sure at this point why we do have it on the p5 friendly error and not on the runtime error. So that's something I can look into. I can also put in a PR to
console-feedto add additional checks before dropping entries fromdata. But definitely the quickest fix is to downgrade to a version that works.Fix editor crashing by downgrading console-feed
raclim commentedon Jul 16, 2023
Thanks so much @JasonGoemaat @wong-justin @lindapaiste for working together to resolve this! I'm really sorry that this happened due to my major oversight in upgrading the
console-feedpackage 😭I just pushed out a new release with the changes, and tweaked @wong-justin's PR afterwards to include the updates to the lockfile as well. It seems to be working for me for now, but please let me know if this persists. Sorry again about this!
fixes processing#2298 install console-feed at v3.2.0