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

207
Visualizações
Uncaught NotFoundError

I'm new to javascript and i'm currently trying to write an extension that tracks all URLs visited by a user. I'm doing research for a professor, and was told to use indexedDB to track the URLs. I keep getting the following error:

Uncaught NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.

Below is my code:::

let request = window.indexedDB.open("MyTestDatabase", 1),
  db,
  tx,
  store,
  index;

request.onerror = function (e) {
  console.log("The database 'linkStorage' could not be opened");
};

request.onupgradeneeded = function (e) {
  let db = request.result,
    store = db.createObjectStore("webpage", { autoIncrement: true }),
    index = store.createIndex("link no.", "webpage", { unique: false });
};

request.onsuccess = function (e) {
  db = request.result;

  tx = db.transaction("webpage", "readwrite");
  store = tx.objectStore("URL");
  index = store.index("link no.");

  db.onerror = function (e) {
    console.log("ERROR" + e.target.errorCode);
  };

  var link = location.href;
  store.put(link);
  tx.oncomplete = function () {
    db.close();
  };
};

can someone please help?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You probably created the database without running your onupgradeneeded function. It never created the object store. Try incrementing your version and opening the database again. If the store is still not present, you have not hooked the upgradeneeded event properly.

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