JS file gets a net::ERR_ABORTED 404 (Not Found)

Active3 hr before
Viewed126 times

7 Answers


As mentionned in comments: you need a way to send your static files to the client. This can be achieved with a reverse proxy like Nginx, or simply using express.static().,Querying your index.js file in the client thus becomes:,Find centralized, trusted content and collaborate around the technologies you use most., What is an expedience of sci-fi gliders? these machines flying near the very ground

Put all your "static" (css, js, images) files in a folder dedicated to it, different from where you put your "views" (html files in your case). I'll call it static for the example. Once it's done, add this line in your server code:

app.use("/static", express.static('./static/'));
load more v

How To Solve JS file gets a net::ERR_ABORTED 404 (Not Found) Error ?,How JS file gets a net::ERR_ABORTED 404 (Not Found) Error Occurs ?,Hello Guys, How are you all? Hope You all Are Fine. Today I am just run my simple web socket project But I am facing following error JS file gets a net::ERR_ABORTED 404 (Not Found) in Javascript. So Here I am Explain to you all the possible solutions here., [Solved] Command CompileSwiftSources failed with a nonzero exit code xcode 13

Today I am just run my simple web socket project But I am facing the following error

JS file gets a net::ERR_ABORTED 404(Not Found)
load more v

I know that this question is not first but I don't know where to look for solution. I have an express backend server. It has to render HTML page with main.js in it when it launches.,my question on stackoverflow (where the code is highlighted):,public/main.js obviosly is a client script that is not found on a server but found in localhost.,https://stackoverflow.com/questions/66623691/error-get-js-file-neterr-aborted-404-not-found-node-js

app.js code:

var createError = require('http-errors');
var express = require('express');
var path = require('path');
// <...>
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var app = express();
app.set('views', path.resolve(__dirname, 'views'));
app.set('view engine', 'jade');
   extended: false
app.use(express.static(path.resolve(__dirname, 'public')));
var listener = app.listen(5000, function() {
   console.log('Listening on port ' + listener.address().port);
app.use('/', indexRouter);
app.use('/users', usersRouter); // catch 404 and forward to error handler app.use(function(req, res, next) {   next(createError(404)); });  // error handler app.use(function(err, req, res, next) {   // set locals, only providing error in development   
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {}; // render the error page
res.status(err.status || 500);
module.exports = app;
load more v

2127.0.0.1/:25 GET net::ERR_ABORTED 404 (Not Found),As long as the script exists and you have the required

<!doctype html>

<html lang="en">
        <meta charset="utf-8">

        <title>The HTML5 Herald</title>
        <meta name="description" content="The HTML5 Herald">
        <meta name="author" content="SitePoint">

        <link rel="stylesheet" href="static/style.css">


        <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script>

        <canvas id="chart" width="400" height="400"></canvas>

        <script src="static/client.js"></script>
        <script src="{process.env.BROWSER_REFRESH_URL}"></script>
load more v

Tutorial Guruji ,This website works best with JavaScript enabled.,Online Free Tutorials Guruji Guide & Materials – Solved Questions Answers, How to convert an array of integers to a single digit

   --index.html |
   --index.js `-- server.js
load more v

but in the browser, I get this error,the files exist but its not find them after the html gets served,i didn’t think about having to serve everything to the browser. putting things in a folder named public makes sense now,edit: the above will serve all the content from a src folder so in a case of

However sendFile close the response so I don’t think you can:

res.sendFile('index.js') // the response gets closed.
load more v

How can i solve net::ERR_ABORTED 404 (Not Found) in a view, error dont let display the css Laravel 6.0 ,<link stylesheet="" href=""> and script ind head tag,Below i will let the code of my scripts ,the links in the head and also the information i want to show,Says exactly like thisGET net::ERR_ABORTED 404 (Not Found) and GET net::ERR_ABORTED 404 (Not Found) in the console with every js or css in the stylesheet and scripts

<link stylesheet="" href=""> and script ind head tag

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <script src="{{ asset('js/app.js') }}" defer></script>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/open-iconic-bootstrap.min.css">
    <link rel="stylesheet" href="css/animate.css">
    <link rel="stylesheet" href="css/owl.carousel.min.css">
    <link rel="stylesheet" href="css/owl.theme.default.min.css">
    <link rel="stylesheet" href="css/magnific-popup.css">
    <link rel="stylesheet" href="css/aos.css">
    <link rel="stylesheet" href="css/ionicons.min.css">
    <link rel="stylesheet" href="css/bootstrap-datepicker.css">
    <link rel="stylesheet" href="css/jquery.timepicker.css">
    <link rel="stylesheet" href="css/flaticon.css">
    <link rel="stylesheet" href="css/icomoon.css">
    <link rel="stylesheet" href="css/style.css">
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">


<script src="js/jquery.min.js"></script>
<script src="js/jquery-migrate-3.0.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/jquery.waypoints.min.js"></script>
<script src="js/jquery.stellar.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/aos.js"></script>
<script src="js/jquery.animateNumber.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/scrollax.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBVWaKrjvy3MaE7SQ74_uJiULgl1JY0H2s&sensor=false"></script>
<script src="js/google-map.js"></script>
<script src="js/main.js"></script>

things i want to show in the view

@foreach ($detalle_venta_entrada as $item)
                                <td class="image-prod"><div class="img" style="background-image:url(ticket_event.jpg);"></div></td>
                                <td class="product-name">
                                <p>Esta entrada es de uso unico y exclusivo para este evento</p>
                  <td class="price">{{$item->precio}}}</td>
                              <td class="total">{{$item->precio}}</td>
                              </tr><!-- END TR-->
load more v

Other "undefined-undefined" queries related to "JS file gets a net::ERR_ABORTED 404 (Not Found)"