# Facing error "Failed to load resource: the server responded with a status of 404 (Not Found)" in web browse console

**URL:** <https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433>\
**Category:** p5.js\
**Created:** [August 7, 2018, 3:41am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433 "2018-08-07T03:41:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 7, 2018, 3:41am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/1 "2018-08-07T03:41:23Z")

</div>

I was trying to follow [this tutorial](https://www.youtube.com/watch?v=2hhEOGXcCvg&list=PLRqwX-V7Uu6b36TzJidYfIYwTFEq3K5qH&index=2). 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:

![Capture](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/5ef14cb58db621ec5d4dcc6671041b658e9b8cc0.PNG)

How can I solve this issue?

This question has also been posted here:

> <https://stackoverflow.com/questions/51718561/facing-this-error-failed-to-load-resource-the-server-responded-with-a-status-o>

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 7, 2018, 3:44am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/2 "2018-08-07T03:44:43Z")

</div>

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](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](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  
> at common.js:263

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 7, 2018, 4:03am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/3 "2018-08-07T04:03:48Z")

</div>

> **[Code 800A0404 issue](https://Discourse.Processing.org/t/code-800a0404-issue/2036/3?u=gotoloop)**
>
> Easiest & fastest recipe to run “.js” sketches under p5.js: 🏃 Install any Firefox-based browser in your OS and use it to open your “index.html” file: 🦊 Install Notepad2 or Notepad++ (or both) in your OS and use it to type in your “sketch.js”...

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 7, 2018, 4:12am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/4 "2018-08-07T04:12:08Z")

</div>

I am able to open index.html file in browser but drag and drop.  
but it’s not opening through server.  
I want it to open through server.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 7, 2018, 4:16am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/5 "2018-08-07T04:16:07Z")

</div>

- [GitHub.com/processing/p5.js/wiki/Local-server](http://GitHub.com/processing/p5.js/wiki/Local-server)

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 7, 2018, 4:37am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/6 "2018-08-07T04:37:14Z")

</div>

I have followed node.js method.

Can you please review the error I am getting?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 7, 2018, 5:46am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/7 "2018-08-07T05:46:54Z")

</div>

- If you’ve got “browser-sync” installed in node.js already: `npm -g i browser-sync`
- Go to the folder your “index.html” file is.
- Now, while holding down the SHIFT key, right-click somewhere empty.
- An “Open Command Prompt Here” should show up as 1 of the options.
- Once in the prompt, type in: `browser-sync`.
- The default browser should open and your “index.html” should automatically run there.

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 7, 2018, 5:57am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/8 "2018-08-07T05:57:04Z")

</div>

I have done so. but it is not showing anything.

Still the same error is in console.

what can i try now?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 7, 2018, 6:17am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/9 "2018-08-07T06:17:16Z")

</div>

> [@satyamgaba](#):
>
> What can i try now?

You can still try out my own “index.html” file from the forum link I’ve posted in my 1st reply to you. 🗃

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 7, 2018, 8:10am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/10 "2018-08-07T08:10:27Z")

</div>

I tried using your script, still it’s not working when i try to access it with server.

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [August 7, 2018, 3:02pm UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/11 "2018-08-07T15:02:26Z")

</div>

Maybe you can tell us how you setup your local server. What steps did you follow? Are they included in the video? Don’t forget to include your OS.

Notice that Shiffman’s example is one step advance. In your case, you can deliver a webpage via a local server first.

Kf

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [August 7, 2018, 4:40pm UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/12 "2018-08-07T16:40:24Z")

</div>

If you post your question to multiple sites, please link between the posts so we know what help you’ve already received. This question has also been asked here:

> <https://stackoverflow.com/questions/51718561/facing-this-error-failed-to-load-resource-the-server-responded-with-a-status-o>

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 8, 2018, 3:24am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/13 "2018-08-08T03:24:33Z")

</div>

I am new to these forums and I was not aware of the code of conduct. I will keep this thing in mind from now.  
Thanks.

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 8, 2018, 3:25am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/14 "2018-08-08T03:25:51Z")

</div>

Same steps as in videos.

this is my server code ![server](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/9/964c21a78e6204e7081cba30ff7894c48c8e1f82.png)

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 8, 2018, 3:28am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/15 "2018-08-08T03:28:57Z")

</div>

I think there is some issue with relative addressing in intex.html.

when i replaced the script line with `<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.min.js" type="text/javascript"></script>` it started working. How to fix that?

this is the index.html file before this edit.

 ![index](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a2eb6e1733465b60a17f60492e7c15c6990ae537.png)

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [August 8, 2018, 3:51am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/16 "2018-08-08T03:51:47Z")

</div>

Hi  
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.

Second question: Did you change the **src** entries in your _index.html_ file to point to your javascript files? For instance, you have `../p5.min.js` in your index.html file. Where is this javascript file located with respect to the index.html file? Are they in the same folder OR is the js file one folder below?

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.

So the first thing to do is to check the javascript files location. If the src definition is pointing to the files properly, then the next step is to make sure you can run index.html directly by double clicking on the file. It should be launched in a new browser window and it should execute. Notice this is executing the file as a client, not running the local host environment.

Let us know if this helps.

Kf

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 8, 2018, 3:56am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/17 "2018-08-08T03:56:39Z")

</div>

- AFAIK, p5js is a JS library which targets browsers, not servers! 🏄‍♂️
- The server makes available the “.html” file which will load & run the “p5.js” file and its “.js” sketch. 👷‍♂️
- But it’s the browser accessing that server which actually runs all of those “.js” files. 🏃‍♂️

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 8, 2018, 3:57am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/18 "2018-08-08T03:57:58Z")

</div>

> [@kfrajer](#):
>
> What editor are you using to edit your code?

It seems Notepad++ to me. 🗒

---

<div class="post-metadata">

**Author:** ![satyamgaba](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Post date:** [August 8, 2018, 7:06am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/19 "2018-08-08T07:06:22Z")

</div>

Hi, I am using sublime text editor for writing js and server.

I am running the server code through cmd window. and opening `http//:localhost:3000` in google chrome and webpage doesn’t open.

but when I open index.html by double clicking it, it opens the webpage I designed.

This is how my directory looks like  
the public folder has 2 files, sketch.js, and index.html.

 ![directory](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/3217a4c1233f18f8c8e41323a5f822afd28fce5f.png)

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [August 8, 2018, 2:17pm UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433/20 "2018-08-08T14:17:28Z")

</div>

> [@satyamgaba](#):
>
> but when I open index.html by double clicking it, it opens the webpage I designed.

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:

1. What command are you using to spin the server?
2. 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.

Kf

[Next page](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433.md?page=2)
