-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
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.1.2
Web browser and version
Google Chrome Version 143.0.7499.170
Operating system
Windows 11
Steps to reproduce this
Steps:
-
Open the p5.js Web Editor
-
Ensure Friendly Errors are enabled (default)
-
Run the sketch below
-
Observe a Friendly Error warning in the console
Snippet:
function setup() {
noCanvas();
noiseDetail(1);
console.log(noise(0.5));
}
Expected behaviour:
According to the documentation, the second argument to noiseDetail() (falloff) is optional because a default value (0.5) is defined. Calling noiseDetail(1) should therefore be valid and should not trigger a Friendly Error warning.
Actual behaviour:
p5.js displays a Friendly Error warning:
“Expected number at the second parameter in noiseDetail()”
even though the call is valid and the sketch runs correctly.
Additional confirmation:
When p5.disableFriendlyErrors = true is set, the warning disappears, confirming this is an FES validation bug rather than a problem with noiseDetail() itself.
I’m happy to help implement a fix if this is approved.