I’m experiencing an issue with my p5.play.js project. When I test it locally on my VSCode environment, everything functions without problems. However, when I attempt to deploy it to GitHub Pages, I only get a blank screen with a white background. It seems like the initial setup of p5.js is loading since I can see the canvas, but none of my game’s visuals or interactions are appearing. I’ve checked my file paths and even explored other hosting options, but the issue persists. Has anyone else had similar experiences with deploying p5.play.js on GitHub Pages? What could be the underlying cause for this discrepancy between local testing and online deployment?
Hit this exact same issue last month - spent hours pulling my hair out! It’s how p5.play.js loads assets differently on GitHub Pages vs running locally. Your browser handles file access totally different when it’s local versus on a web server. Pop open your dev console on the GitHub Pages version and you’ll probably see CORS errors or assets failing to load. Make sure your image and sound paths are relative (no leading slashes) and that you’ve actually committed all your assets to the repo. Also check that index.html is in your root directory or your GitHub Pages settings are right. When the canvas shows up but everything else is missing, it’s almost always asset loading problems, not your code.