Skip to content
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

[p5.js 2.0 Beta Bug Report]: FES in 2.0 does not anticipate loading problems #7533

Open
2 of 26 tasks
ksen0 opened this issue Feb 10, 2025 · 0 comments
Open
2 of 26 tasks

Comments

@ksen0
Copy link
Contributor

ksen0 commented Feb 10, 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

2.0-beta.2

Web browser and version

Chrome

Operating system

MacOSX

Steps to reproduce this

Steps:

  1. Get one of the 1.x reference examples of a function to load some object in preload, ensure it runs with a working file on loading
  2. Update the p5.js script to use the current p5.js 2.0 beta library
  3. Try to run and the error is something related to trying to use the specific object, but the variable is undefined. Thus, the FES wraps a TypeError without clearly guiding the user to the real issue, which is that preload has not been called and the object is empty.

All loaders that might be affected:

Snippet:

Here are two examples in to different loader functions (code needs files to run):

  • loadImage example fails on image(img, 0, 0); with TypeError: Cannot read properties of undefined (reading 'width')...
  • loadModel example fails on model(shape); with TypeError: Cannot read properties of undefined (reading 'vertices')...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant