Skip to content

Dexie.debug

David Fahlander edited this page Jun 7, 2016 · 17 revisions

Since 1.4.0

Gets or sets whether exception's stacks will have long-stack support. This is really useful when debugging your app, but can decrease performance a little in production.

Hosted web apps

If this property is not set, the mode will be detected by the url that serves your app (By reading location.href). If served from localhost or 127.0.0.1, Dexie.debug will be true by default. Else, it will be false.

The auto-detection of debug mode is perfect when developing internet-hosted web applications, because you typically develop them locally but publish them on a real URL.

Electron apps

Electron apps are served from file:/// - urls, no matter whether it is development or production. So Dexie.debug will defauilt to false for Electron apps. Therefore, you should always set Dexie.debug = true; in your Electron app while developing it, but not in production. Use a build step to set Dexie.debug to true/false depending on debug / production build.

Build-step sample

Somewhere in your app:

require('dexie').debug = require('dexie-debug.json');

Then in your build-step, overwrite 'dexie-debug' with false or true depending on build output.

Clone this wiki locally