Skip to content

noCanvas() shows error in the console #7699

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

Closed
4 of 17 tasks
darkwave opened this issue Apr 4, 2025 · 5 comments
Closed
4 of 17 tasks

noCanvas() shows error in the console #7699

darkwave opened this issue Apr 4, 2025 · 5 comments
Labels

Comments

@darkwave
Copy link

darkwave commented Apr 4, 2025

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

1.11.1

Web browser and version

Chrome 135.0.7049.52

Operating system

Linux

Steps to reproduce this

Steps:

  1. Copy noCanvas() example
  2. Run
  3. Get errors

Snippet:

function setup() {
  noCanvas();
}

Error generated:

TypeError: Cannot read properties of null (reading 'parentNode')
    at _main.default._createOutput (https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:53791:59)

    at _main.default.textOutput (https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:53617:18)

    at _ensureAccessibleCanvas (/index.html:22:43)

    at p5.callRegisteredHooksFor (https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:66152:30)

    at _setup (https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:66317:21)

    at _runIfPreloadsAreDone (https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:66228:27)

    at p5._decrementPreload (https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:66239:25)

    at p5.<anonymous> (https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/addons/p5.sound.min.js:2:98292)

Followed by the "pretty version":


🌸 p5.js says: 
[p5.js, line 53791] The property of null can't be read. In javascript the value null indicates that an object has no value.

+ More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property#what_went_wrong 
┌[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:53791:59] 
	 Error at line 53791 in _main.default._createOutput()
└[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:53617:18] 
	 Called from line 53617 in _main.default.textOutput()
└[blob:https://preview.p5js.org/63423829-9061-4aaa-bdb3-912461faf2c9:22:43] 
	 Called from line 22 in _ensureAccessibleCanvas()
└[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:66152:30] 
	 Called from line 66152 in p5.callRegisteredHooksFor()
└[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:66317:21] 
	 Called from line 66317 in _setup()
└[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:66228:27] 
	 Called from line 66228 in _runIfPreloadsAreDone()
└[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/p5.js:66239:25] 
	 Called from line 66239 in p5._decrementPreload()
└[https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.11.3/addons/p5.sound.min.js:2:98292] 
	 Called from line 2 in p5.<anonymous>()
 
@darkwave darkwave added the Bug label Apr 4, 2025
Copy link

welcome bot commented Apr 4, 2025

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

@ksen0
Copy link
Member

ksen0 commented Apr 4, 2025

HI @darkwave ! I tried to reproduce here and was not able to: https://editor.p5js.org/ksen0/sketches/Mj_B30bik

Could you give a bit more detail about your setup? If it's possible to reproduce this error in the p5.js Editor, could you share a link here please?

@perminder-17
Copy link
Contributor

I am not sure much, but it looks like something went wrong in the index.html file where you tried importing libraries. Can you share your index.html file as well?

@ksen0
Copy link
Member

ksen0 commented Apr 18, 2025

Hi all, I'll close this because it's not clear if this is a bug, but please feel free to reopen with further findings! If it's an issue in the specific sketch, please feel free to ask for help in the Discourse forum

@ksen0 ksen0 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2025
@darkwave
Copy link
Author

I cannot reproduce the error anymore. That's good news 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@darkwave @ksen0 @perminder-17 and others