Today We are Going To Solve JS file gets a net::ERR_ABORTED 404 (Not Found) in Javascript. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.
Contents
How to Fix JS file gets a net::ERR_ABORTED 404 (Not Found) Error?
- How to Fix JS file gets a net::ERR_ABORTED 404 (Not Found) Error?
To Fix JS file gets a net::ERR_ABORTED 404 (Not Found) Error just Put your static files. First of all Put all your “static” files in a folder dedicated to it, different from where you put your “views” then add this line in your server code:
app.use("/static", express.static('./static/'));
And this will serve every file in your “static” folder via the /static route. Querying your index.js file in the client thus becomes just like below. And by doing this you will solve your error.<script src="static/index.js"></script>
I hope this will help you. - JS file gets a net::ERR_ABORTED 404 (Not Found)
To Fix JS file gets a net::ERR_ABORTED 404 (Not Found) Error just Put your static files. First of all Put all your “static” files in a folder dedicated to it, different from where you put your “views” then add this line in your server code:
app.use("/static", express.static('./static/'));
And this will serve every file in your “static” folder via the /static route. Querying your index.js file in the client thus becomes just like below. And by doing this you will solve your error.<script src="static/index.js"></script>
I hope this will help you.
Solution 1 : Put your static files
First of all Put all your “static” files in a folder dedicated to it, different from where you put your “views” then add this line in your server code:
app.use("/static", express.static('./static/'));
And this will serve every file in your “static” folder via the /static route. Querying your index.js file in the client thus becomes just like below. And by doing this you will solve your error.
<script src="static/index.js"></script>
I hope this will help you.
Conclusion
So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.
Also Read This Solutions
- Can’t perform a React state update on an unmounted component in React-hooks.
- ImportError: No module named ‘mysql’
- Execution failed for task ‘:app:checkDebugAarMetadata’
- Could not install packages due to an EnvironmentError: [Errno 13] Permission denied
- ImportError: libGL.so.1: cannot open shared object file: No such file or directory