Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

706
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda