Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!