-
Notifications
You must be signed in to change notification settings - Fork 79
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
Error: Failed to execute 'transaction' on 'IDBDatabase' while changing routes #220
Comments
What browser/OS are you seeing this in? When you say "changing routes," what do you mean exactly? Are you changing routes in a multi-page app or single-page app – i.e. are these actual page navigations, or in-app pseudo-navigations? I'm not sure it helps, but you may want to look into the Page Lifecycle API. In particular, in the section on the "frozen" event, note that it recommends "Close all open IndexedDB connections." In document.querySelector('emoji-picker').database.close() |
Related discussion: jensarps/IDBWrapper#80 |
Hi Nolan, We have a web component library where we use this package and then use it inside an electron app which has a Vue app, it's a SPA. So what happens is that when we change the route I see the error in the logs. |
I see, so it's Chromium and this is an in-SPA pseudo-navigation. So I imagine the Do you have a stacktrace? Or is it just the single warning message in the console? Also I found a Chrome bug: https://crbug.com/1085724 |
Yeah I think so
Unfortunately no, it's just a single warning |
Thanks for the help though I will try out some suggestions that you made and get back to you. |
@nolanlawson Manually closing the database before changing the route fixed the issue. Thanks for all the help. |
Sounds good! Thanks. |
This worked for me. Thanks! |
This does not work for me. Looks like the component gets unmounted by react before the database close function completes. Any suggestions? |
@ekimber Can you call |
I can call it before it unmounts, however, it is of course async, and from what I can observe, the unmount is occurring before the close promise completes |
Actually that may be wrong. I tried pausing execution there but it doesn't help.
|
You might need to do an unhandled rejection event listener or something.
|
Thanks, I managed to get rid of the warning by doing this |
While changing routes I get this error
DOMException: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing
.I am using this inside web component which is then imported inside a Vue app, app/ component is not crashing or anything just seeing this as an error log.
The text was updated successfully, but these errors were encountered: