processing / processing/p5.js

[p5.js 2.0+ Bug Report]: Some Vector friendly errors don't work correctly

Open
#8,930 11 comments 0 reactions 1 assignee View on GitHub

@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:
  1. Run the snippet below. It has an error; the first param should be a vector.
  2. The expected output is a friendly error message "The v1 parameter should be of type Array or p5.Vector"
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.