Skip to content

Warns about reserved function 'row' which is not a p5js function #3427

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

Open
jareddonovan opened this issue Apr 3, 2025 · 1 comment
Open
Labels

Comments

@jareddonovan
Copy link
Contributor

p5.js version

1.11.11, 1.11.13

What is your operating system?

Mac OS

Web browser and version

Google Chrome 131.0.6778.86

Actual Behavior

For a sketch that declares a variable 'row', the editor produces the following warning:

🌸 p5.js says: you have used a p5.js reserved function "row" make sure you change the function name to something else.

+ More info: https://p5js.org/reference/p5/row 

But there doesn't appear to be a 'row()' function in the reference (link in warning message leads to 404).

Following sketch demonstrates: https://editor.p5js.org/creativecoding/sketches/L03aiuGIu

Tested with 1.11.11 and 1.11.13 versions of p5js.

Expected Behavior

No warning.

Steps to reproduce

Steps:

  1. Following sketch will reproduce in the web editor (https://editor.p5js.org/creativecoding/sketches/L03aiuGIu)

Snippet:

function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
  
  let row = 10;
}
@Jatin24062005
Copy link
Contributor

This issue appears to be resolved in p5.js version 2.0.0. In previous versions, including 1.11.11 and 1.11.13, the editor produces a false warning when using row as a variable name, due to an internal check mistakenly flagging it as a reserved function.

Rename the Variable: Temporarily renaming the variable row to something else (like myRow or rowNumber) will eliminate the warning in the current versions of p5.js.

Check for Updates: If you're using p5.js in a project and don't want to rename your variable, upgrading to p5.js 2.0.0 should resolve the issue. Make sure to update your library to the latest version.

Version 2.0.0

Image

Previous Version (<2.0.0)

Image

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

2 participants