-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Output missing from console (Maximum call stack size exceeded) #3467
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. |
Hey @gohai, thank you so much for opening this issue! This behavior is indeed caused by how the p5.js Web Editor handles console output internally: In the browser's native DevTools console, console.log() can gracefully handle circular references. That said, a similar issue has already been reported in #3178 , and I’ve submitted a fix via [pull request #3424 ] It’s currently pending review. Thanks again for bringing attention to this—it's a critical issue, especially in educational settings. |
Just for information, here's why the error occurs in this case: console.log(select("canvas")) The p5.js Where is the circular reference? It is actually in the (private)
|
Thank you for kindly explaining this to me, @dipamsen. Since even common objects that users may encounter in p5, such as |
Completely agree. There's a temporary fix in #3424 which will show a reasonable output. |
@raclim You may consider closing this issue, as it is similar to Issue #3178, which has already been addressed. Since my Pull Request #3424 has been merged, this issue should now be resolved. |
p5.js version
1.11.5
What is your operating system?
Mac OS
Web browser and version
Chrome 135.0.7049.96
Actual Behavior
Calling
print()
orconsole.log()
on a range of objects is silently failing, in that they aren't printed onto the p5 web editor's console, but still show up in the browser's native console (together with the "Maximum call stack size exceeded" message).This is my number #1 issue in using the web editor in an educational setting presently. I am not sure if my reproducer sketch below has a circular data structure or not, which is why I am opening this separate issue.
Expected Behavior
print()
orconsole.log()
should always output to the console, so that the program flow can be observed using it.Steps to reproduce
Steps:
Snippet:
The text was updated successfully, but these errors were encountered: