The reason why p5js doesn’t “appear” is b/c your sketch contains the keyword import
.
Any JS file containing any of these 2 keywords import
& export
is considered an ES module:
In order for the p5js library to find & callback your functions setup() & draw() they have to be in the outer global context.
We can explicitly place anything in the outer global context by appending it in the property window or globalThis:
This is the model you need to follow in order to have callbacks setup() & draw() in the outer global context on your own ES module sketch: