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

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

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 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