I was trying to follow this tutorial. At ‘10:40’ I see the blank page in web browser.
My server is running like the tutorial. When I checked the console of the webpage in the web browser. I saw that following errors:
If you can not see the photo. These are the errors on browser console:
p5.min.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
localhost/:1 Refused to execute script from ‘http://localhost:4000/p5.min.js’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.
p5.dom.min.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
localhost/:1 Refused to execute script from ‘http://localhost:4000/addons/p5.dom.min.js’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.
p5.sound.min.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
localhost/:1 Refused to execute script from ‘http//localhost:4000/addons/p5.sound.min.js’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.
common.js:263 Uncaught ReferenceError: $st is not defined
There are few things that could not be working here. It can be because of something you did or the editor. The good news is that it can be fixed. We just need more info.
First of all, it is great you tried another solution and you shared it with us. This really helps. My first question is: What editor are you using to edit your code? Are you running the code from this editor? I am guessing you are running the code directly from the browser via local host. I just want to confirm this.
Things are a bit more tricky because you are trying to run this code via localhost. I do not have one setup right now, at least not one with express.
Ok, just to make a distiction, which I know you know but I jsut want to state it to make sure we are in the same channel.
Clicking on the file and opening in a browser is a good test. You are running your html+js as most ppl commonly use it. You are using the browser to render the files. Just to confirm: The p5.min.js was accessed via url or targeting the file on your disk?
Now, your real intentions is to access your page using a local server. You are using express to spin the server and then you you try accessing the page via localhost. Two things:
What command are you using to spin the server?
Is it possible to try a different port number? Try either 12009 or 4900.
I can try setting the express tonight if changing the port doesn’t help. I do not have experience with express but it should work if you are following the same instructions provided by Dan.