Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

708
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda