[p5.js 2.0+ Bug Report]: Some Vector friendly errors don't work correctly
Open
@Ayush4958 is already working on this.
Since Jul 20, 2026.
Area:Math
Bug
p5.js 2.0+
Reserved (CodeDay)
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- WebGPU
- p5.strands
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.3.0
Web browser and version
Brave 1.90.122
Operating system
Linux Mint 22.1
Steps to reproduce this
Steps:
- Run the snippet below. It has an error; the first param should be a vector.
- The expected output is a friendly error message "The v1 parameter should be of type Array or p5.Vector"
- Instead, it gives an error "TypeError: this._friendlyError is not a function"
Snippet:
function setup() {
print(p5.Vector.equals(1, createVector(1, 2)));
}
Discussion
Friendly errors for vectors seem to work fine for instance methods like setValue(), but not for static methods like p5.Vector.equals.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.