-
-
Notifications
You must be signed in to change notification settings - Fork 641
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
How to set Dexie.debug to true? #1806
Comments
Typings are missing for Dexie.debug but it will respect it in regards of console logging. dexie-cloud-addon does not yet respect this value but a new version coming out soon will fix this. See #1801 . |
Hello @dfahlander ! I just saw this issue after I checked the typing and test on my own your enunciated solution.. But it doesn't work currently.. Or at least, it does not seem to have the behavior announced into the doc. For example, this code with the valorization of debug at these 2 places, using just one valorization or the other, or without valorization of debug property, give me this stack :
No info for the origin of this error in my own code. Is it normal? Does I valorized the property badly? NB: I found finally the problem after a little day lost on my own bad code, but I would prefer an info about the source caller if this kind of error will be produced.. Thanks in advance. |
Thanks! This kind of error should be validated earlier in Table.get() to prohibit this kind of native error happening deep within dexie. The async call stack doesn't reveal much. Would also want to look into how Dexie could use Chrome's new async stack tagging Api do improve the call stack. |
Thanks for response, sounds great for the future so! :D |
It's a common pitfall to do db.someTable.get(someVariable) without checking that someVariable isn't null. This is a common pitfall and in the case the call to Table.get() is the initial db call that the application makes, the call stack will be totally unreadable because: 1. Table.get() will first asynchronically auto-open the database. 2. Whe DB is finally opened it will fail deep inside DBCore leaving the user with an unreadable call stack. See #1806 (comment)
…k() instead. We used to have own special support for long async stacks to simplify debugging. However, now all browsers already have long async stacks supported in devtools. This commit removes all special code that deals with long stack support. It also introduces the usage of Chrome's Async Stack Tagging API (console.createTask()) that makes it easier to follow console traces on exceptions and find the application code that initiated the operation. Also, when Dexie.debug is true, we trace all errors from dexie operations with the help of async stack tagging, hopefully making it easier for app developers to find issues in app code. See #1806
* Fail fast on Table.get(undefined) It's a common pitfall to do db.someTable.get(someVariable) without checking that someVariable isn't null. This is a common pitfall and in the case the call to Table.get() is the initial db call that the application makes, the call stack will be totally unreadable because: 1. Table.get() will first asynchronically auto-open the database. 2. Whe DB is finally opened it will fail deep inside DBCore leaving the user with an unreadable call stack. See #1806 (comment) * Cleanse out old "long stacks" support. Use Chrome's console.createTask() instead. We used to have own special support for long async stacks to simplify debugging. However, now all browsers already have long async stacks supported in devtools. This commit removes all special code that deals with long stack support. It also introduces the usage of Chrome's Async Stack Tagging API (console.createTask()) that makes it easier to follow console traces on exceptions and find the application code that initiated the operation. Also, when Dexie.debug is true, we trace all errors from dexie operations with the help of async stack tagging, hopefully making it easier for app developers to find issues in app code. See #1806 * Remove polyfills from test page * Remove _stackHolder not needed anymore
I'm using Dexie "3.2.1" and can't find a way to set Dexie.debug to true.
This is the docs which I used as reference.
https://dexie.org/docs/Dexie/Dexie.debug
Can you help me?
The text was updated successfully, but these errors were encountered: