Skip to content
Advertisement

Uncaught TypeError: store.put is not a function at store.onsuccess

I can’t update any data in IndexedDb. When I run the code it says “store.put is not a function at store.onsuccess”.

  • I tried from many browsers, same error in all
  • I also tried .update instead of .put function but it didn’t work and gave the same error
JavaScript

IndexedDb Browser View

Advertisement

Answer

You issue is on this line: const store = txn.objectStore('floors').get(parseInt(getRoomButtonNumber));

You define store as an IDBRequest.

Obviously, this does not have a put method. You would instead change it to this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement