Browsers can’t directly access files from arbitrary paths outside the HTML file’s folder.
Unless you request a user to do so, either by file drop or file dialog:
- p5.Element::drop()
- p5::createFileInput()
Also you should postpone the sketch initialization until your file is fully loaded.