p5.js preload()

I'm getting a cross origin error from browser whenever i'm trying to load anything from local storage in preload() function in this case i'm trying to load image "Access to Image at 'file:///home/p5/resource/bHeart.png' from origin 'null' has been blocked by CORS policy: Invalid response. Origin 'null' is therefore not allowed access." is there any solutions to this or am i doing something wrong?

var heart; function preload(){ heart = loadImage("resource/bHeart.png"); } function setup(){ createCanvas(windowWidth,windowHeight); } function draw(){ background(0); image(heart,200,200); }



Sign In or Register to comment.