-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unhandled rejection in Chromium #93
Comments
Do you use a custom store name, or custom database name? |
Hmm, no, we just use the defaults: import * as idbKeyval from 'idb-keyval';
// ...
this.store = new idbKeyval.Store(); |
Are you still seeing this? I can't really explain it from looking at the spec, and haven't been able to reproduce it locally. |
Yeah, unfortunately, it happens in production for us about 10-20 times a day (out of 100k users). I looked at our logs and it appears that it only happens when a user switches tabs (from our tab to a different tab) while loading our app. So it's probably a side effect of Chrome reducing resources and throttling async tasks in background tabs. As far as reproducing, it only occurs on Windows & Chrome OS--I don't see any bug reports for Mac. |
@jakearchibald , would it be worth opening a Chromium issue for this (assuming it conflicts with the IndexedDB spec)? I understand your reluctance to add more code to this library for something that occurs so rarely and appears to be a browser quirk. |
Go for it. Although it's difficult to do anything about it without steps to reproduce the issue. |
Over the past few year, we've been seeing a steady trickle of errors in production due to the following line.
idb-keyval/idb-keyval.ts
Line 12 in ea7d507
Error:
Cannot read property 'createObjectStore' of undefined
It only occurs in Chromium browsers (Chrome, Edge Chromium, Opera), and almost exclusively on Windows & Chrome OS. We haven't been able to replicate it, but it's happened to over 900 users by now.
Ideally it would just trigger a Promise rejection, but it doesn't appear to do that (in Sentry is shows up as an unhandled error even though we explicitly handle the Promise rejection).
Would it be worth checking for
openreq.result
before callingcreateObjectStore()
? Thanks!The text was updated successfully, but these errors were encountered: