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
What could be causing transaction for indexeddb to not work in my code
var database = window.indexedDB.open("myTestDatabase", 3);

database.onerror = function(event) {
    alert('Error creating database');
}

database.onupgradeneeded = function(event) {
    var db = event.target.result;

    console.log(1);
    //
    if (!db.objectStoreNames.contains("data")) {
        //Add to indexDB
        db.createObjectStore("data", {
            keypath: "data"
        });
    }
}

//If the database is creaed run.
database.onsuccess = function(event) {
    var db = event.target.result;

    var transaction = db.transaction(["data"], 'readwrite');
    //More code here to store data into indexeddb
}

When running my code, I run into the following error: Uncaught NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.

When looking at the indexeddb, the "myTestDatabase" is created, but the "data" objectstore is not. What might be the problem with this? It works sometimes, but other times it fails.

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