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

157
Visualizações
Failed to load resource: the server responded with a status of 404 (Not Found) Sqlite3.js

I am trying to load an sqlite3 package to the browser using requirejs module and and it won't load.

This is the code of the JavaScript file:

requirejs(['sqlite3'], function (sqlite3) {
// const sqlite3 = require('sqlite3').verbose();
let db = new sqlite3.Database('./db/main.db');
const button = document.querySelector("#btnOnclick");
const fname = document.querySelector("#fname");
button.addEventListener("click", function onclick(event) {


  db.run(`INSERT INTO langs(name) VALUES(?)`, [fname], function(err) {
    if (err) {
      return console.log(err.message);
    }
    // get the last insert id
    console.log(`A row has been inserted with rowid ${this.lastID}`);
  });
db.close();

});
});

and it gives me theis error in the browser console:

screenshot of the browser console

Note:

I am using nodeJs and html & css for this project and the code works fine in my machine but on the browser gives me this error

about 4 years ago · Juan Pablo Isaza
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