Syntax Error Output

I am getting this error “SyntaxError: Expected ; but found {” Is there any way I can fix this error? The error only shows when I save the file.

Hi Daniel_Tex, the error appear when saving… but it run? can you post code?

You forgot a “;” somewhere.

Here is my code, note that I am using p5.js. And the error only shows when the sketch has been saved.

void setup() {
   size(600,600,1);
   noStroke();
   rectMode(CENTER);
    textAlign(CENTER,CENTER);
   textSize(20);
};

Hi Daniel_Tex, in p5.js you must use a different syntax:

function setup() {
  createCanvas(600, 600,P2D);
  //createCanvas(600, 600,WEBGL); 
  noStroke();
  rectMode(CENTER);
  textAlign(CENTER, CENTER);
  textSize(20);
}
2 Likes

You have a ; on the last line that shouldn’t be there.