Failed to execute 'objectStore' on 'IDBTransaction': The transaction has finished

See original GitHub issue

code: 11 message: “Failed to execute ‘objectStore’ on ‘IDBTransaction’: The transaction has finished.” name: “InvalidStateError”

my code is simple: return await this.table.update(id, { examineDate: data.examineDate }) but,it return error notice like that ↑,I found so many answers from google and github and stackoverflow but no one useful help me please,it’s very urgent, thx @dfahlander 🙏

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:14

github_iconTop GitHub Comments

1reaction
delayhsiaocommented, May 8, 2022

alright, I installed latest version dexie in my project my code in function just has one line ,like this:

async update(data: any) {
return await this.table.update(id, { examineDate: data.examineDate })
}

haven’t transaction around of them. I ever tried to write the transaction around of this codes, but didn’t work

0reactions
dfahlandercommented, May 18, 2022

Can you confirm whether IndexedDBShim is being used or not? If IndexedDBShim is used, you must either avoid using async/await or transpile your code to ES2016 (or ES2015 or ES5) in order to avoid native async/await as it will not work with IndexedDBShim.

In order to use Dexie in node (Electron main process is a node process), IndexedDBShim can be used as an adapter between the IndexedDB API and SQLite, but IndexedDBShim has the same issues as browsers used to have historically - it won’t keep transactions alive between micro ticks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IndexedDB when populating many ObjectStores, Error: Failed ...
DOMException: Failed to execute 'objectStore' on 'IDBTransaction': The transaction has finished. at IDBTransaction.objectStore.transaction.
Read more >
Failed to execute 'objectStore' on 'IDBTransaction ... - GitHub
Within the each() callback, you're code is executing within a transaction that only has 'options' table in it. When you call getStep(), ...
Read more >
IDBTransaction.objectStore() - Web APIs - MDN Web Docs
The objectStore() method of the IDBTransaction interface returns an ... has been deleted or removed, or if the transaction has finished.
Read more >
transaction-and-objectstore-calls-expected.txt - Google Git
Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The transaction has finished. Expecting exception from store.index('index'). PASS ...
Read more >
IDBTransaction.error - Web APIs - UDN Web Docs: MDN Backup
The IDBTransaction.error property of the IDBTransaction interface returns one of ... transaction on our database and add some data to an object store....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found