-
-
Notifications
You must be signed in to change notification settings - Fork 642
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
Maximum call stack exceeded when running Dexie with zone.js 0.8.18 #589
Comments
|
Ionic is using zone.js in a polyfill and ignores the zone.js version defined by package.json. Using dexie with a polyfill that contains zone.js 0.8.17 works, but dexie will fail when using zone.js 0.8.18 |
May be related to angular/zone.js#899 |
This line is problematic since zone.js 0.8.18: Removing the line works for me, but I guess that will have side effects. Any chance someone with more knowledge could look into this? |
Thanks for notifying about this change in zone.js. I read about the threads you linked to and the changes in zone 0.8.18. The direct impact of removing that line, is that indexedDB transactions break on some browsers. However, on most modern browsers today (Edge, Safari >=10.1, Chromium, but not Firefox or IE), it will work just fine, as they have made their IndexedDB API Promise compatible within transactions (see #317). My suggestion would be that we should replace the property rather than calling the setter. I assume zone.js leaves the "Promise" property configurable. If so, we should replace/restore the property rather than just set window.Promise. This would probably fix the issue. I just made a pull request #590 that does this. @duydao Could you test it for me? In regards to the state of modern browsers today (except Firefox), I might also consider feature-testing whether replacing window.Promise is needed or not and leave out the line for browsers that already has a healthy relationship between their IndexedDB and Promise implementations. |
As a side note: we're not dribbling out zonejs here, even though it might seem so. When Dexie.Promise needs to schedule a micro task, it does that by invoking the unchanged global Promise' prototype.then(), which is a zonejs controlled Promise implementation. And any macro tasks are only invoked by indexedDB events, which are also controlled by zonejs. |
Closing this as it is solved in master branch. |
I'm getting the following error when accessing any database using Ionic 3.7:
The message keeps repeating in the console.
I've tested the following things:
I've reproduced the problem by creating a fork from the ionic conference example app, which be used like this:
localhost:8100
with chrome when the server is readywindow.dexieService.friends.count().then(console.log).catch(console.error)
in the dev consoleThe dexie implementation can be found in
src/pages/schedule/schedule.ts
and is as simple as this:any hints on how I can debug this error?
The text was updated successfully, but these errors were encountered: