Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

715
Views
GET http://localhost:3000/insert.js net::ERR_ABORTED 404 (Not Found)

I'm a beginner at web dev, I'm currently working on a project, but the javascript file insert.js won't load. The html document, upload.html is inside the public folder, and the javascript is inside the main folder. I used the following path to link the javascript file,

<script src= "../insert.js"></script>

But it didn't seem to work, so I then tried moving upload.html to the main folder, which is HR and I used the following code,

<script src = "/insert.js"></script>

And this didn't work either, so I then tried moving insert.js to the public folder, and used the same path as I have mentioned above, but, then I couldn't export variables to app.js which is located in the main HR directory.

The image I have attached shows location of the files

I don't get what could possibly cause this, I think I should mention this as well, but I got an error while running my javascript file in node. So I inserted the following code in node_modules/whatwg-url/dist/encoding.js:

const {TextDecoder, TextEncoder} = require("util");

I don't know if this has anything to do with my issue, but I thought I would just mention it.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

localhost can only access your public folder, so you have to move insert.js in the public folder and do:

<script src = "index.js"></script>

Also if you have node modules in that javascript file it wont run because it can't run the modules and you would have to use a bundler for that js file like webpack, rollup or snowpack.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!