-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Console.log() printing to browser console instead of p5 console #2518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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. |
I've been running into this issue too both on mobile and web. |
If you're looking for a timeline, this issue just started yesterday (10/19/2023) and seems to be unrelated to the version of p5.js. This issue is extremely problematic for us teachers. We'll eventually get to all the amazing graphics that p5 has to offer within the canvas, but we start with the basics using the console and vanilla JavaScript within p5's web editor. (students aren't allowed to inspect the page in most school districts) |
We just pushed a new release to production earlier this week on Wednesday, so this issue probably stems from one of the changes in this release. I'll look into it and will try to have an update for it soon! |
FYI I forgot to mention that this is affecting everything meant for the console. So not only console.log statements but all errors and warnings as well. |
can you give me a little hint on how to approach this issue? |
I guess the console handler is not Implementing a system to capture and display code editor errors in your console window , With addition of Error Handling in Code Editor and use of dispatching errors to redux Store and would have to update console.jsx , Am i going in right direction @lindapaiste @raclim , I think adding these can solve this error if there are some suggestion please let me know and if this approach seems fine do assign me this issue i will start working on it |
It is working fine for me in Windows 10 on Chrome, Firefox, Edge, and Opera. @raclim If I have to guess, I think the issue is probably related to your note in the fix PR "to address an error where the target origin does not match the recipient for the iFrame." Another suspect would be #2426. But we've always had the console errors script running first with
|
For anyone looking at this, it's honestly pretty complicated. The user's code is executed in an iframe from preview.p5js.org. We send messages from that frame to the editor using postMessage. The relevant code is primarily in: p5.js-web-editor/client/utils/previewEntry.js Lines 1 to 180 in 362b553
p5.js-web-editor/client/utils/dispatcher.js Lines 4 to 69 in 362b553
p5.js-web-editor/client/modules/Preview/EmbedFrame.jsx Lines 280 to 288 in 362b553
p5.js-web-editor/client/modules/IDE/components/PreviewFrame.jsx Lines 16 to 22 in 362b553
p5.js-web-editor/client/modules/IDE/components/Console.jsx Lines 222 to 228 in 362b553
(The lack of a dependency array on all of the |
Hi all, I think this error should be resolved by a different @lindapaiste refers to earlier in @2426. I just reverted it in #2547 and deployed it to production just now. I think this should fix it, but please let me know if this is still happening! |
p5.js version
most recent I'm assuming.
What is your operating system?
Windows
Web browser and version
Firefox Version 118.0.1
Actual Behavior
Console.log is printing to the browser's console
Expected Behavior
console.log should print to the p5 editor console
Steps to reproduce
Steps:
Snippet:
The text was updated successfully, but these errors were encountered: