No description
Find a file
2026-06-05 09:26:24 -06:00
.github chore: attest 2026-05-14 22:45:34 -06:00
.husky chore: update template 2026-04-08 07:52:31 -06:00
images Update README 2025-04-12 16:33:09 -06:00
scripts test: fix 2026-05-26 07:34:29 -06:00
src chore: lint 2026-06-04 18:48:58 -06:00
.editorconfig Template 2025-03-20 13:51:51 -06:00
.gitattributes Template 2025-03-20 13:51:51 -06:00
.gitignore test: fix 2026-05-26 07:34:29 -06:00
.markdownlint-cli2.mjs chore: update template 2026-04-08 07:52:31 -06:00
.nano-staged.mjs chore: update template 2026-04-08 07:52:31 -06:00
.npmrc Template 2025-03-20 13:51:51 -06:00
CHANGELOG.md chore: release 1.9.7 2026-05-26 22:50:06 -06:00
commitlint.config.ts chore: update template 2026-04-08 07:52:31 -06:00
CONTRIBUTING.md refactor: rename files and directories to kebab-case 2026-05-13 13:29:26 -06:00
cspell.json refactor: new template 2026-05-20 00:06:32 -06:00
eslint.config.mts chore: update template 2026-04-08 07:52:31 -06:00
LICENSE Template 2025-03-20 13:51:51 -06:00
manifest.json chore: release 1.9.7 2026-05-26 22:50:06 -06:00
package-lock.json chore: update libs 2026-06-05 09:26:24 -06:00
package.json chore: update libs 2026-06-05 09:26:24 -06:00
README.md test: increase coverage 2026-05-26 12:22:39 -06:00
tsconfig.json chore: remove stale tsconfig include for nonexistent file 2026-05-28 08:26:23 -06:00
versions.json chore: release 1.9.7 2026-05-26 22:50:06 -06:00
vitest.config.ts test: add 2026-05-14 22:44:31 -06:00

Advanced Debug Mode

Buy Me a Coffee GitHub release GitHub downloads Coverage: 100%

This is a plugin for Obsidian that enhances Obsidian debug mode.

Features

Obsidian Debug mode

The plugin adds an easy way to switch Obsidian debug mode on/off. When active, inline source maps will not be stripped from loaded plugins.

Long stack traces

Error stack traces are usually very limited and stack frames for function like setTimeout or addEventListener are usually not included, so sometimes it's difficult to find the root cause of the error.

The plugin tries to preserve long stack traces as much as possible.

Long stack traces

function foo1() {
  setTimeout(foo2, 100);
}

function foo2() {
  const intervalId = setInterval(foo3, 100);
  setTimeout(() => {
    clearInterval(intervalId);
  }, 150);
}

function foo3() {
  queueMicrotask(foo4);
}

function foo4() {
  requestAnimationFrame(foo5);
}

function foo5() {
  process.nextTick(foo6);
}

function foo6() {
  setImmediate(foo7);
}

function foo7() {
  Promise.resolve().then(foo8);
}

function foo8() {
  Promise.reject(new Error('Error from Promise')).catch(foo9);
}

function foo9() {
  Promise.resolve().finally(foo10);
}

function foo10() {
  const div = createDiv();
  div.addEventListener('click', foo11);
  div.click();
}

function foo11() {
  throw new Error('Error from foo11');
}

foo1();

Without the plugin you get the error in the console

Uncaught Error: Error from foo11
    at HTMLDivElement.foo11 (<anonymous>:47:9)
    at foo10 (<anonymous>:43:7)
    at <anonymous>

With the plugin you get

Uncaught Error: Error from foo11
    at HTMLDivElement.foo11 (<anonymous>:47:9)
    at foo10 (<anonymous>:43:7)
    at <anonymous>
    at --- addEventListener --- (0)
    at foo10 (<anonymous>:42:7)
    at --- Promise.finally --- (0)
    at foo9 (<anonymous>:37:28)
    at --- Promise.catch --- (0)
    at foo8 (<anonymous>:33:56)
    at --- Promise.then --- (0)
    at Immediate.foo7 (<anonymous>:29:21)
    at --- setImmediate --- (0)
    at foo6 (<anonymous>:25:3)
    at --- process.nextTick --- (0)
    at foo5 (<anonymous>:21:11)
    at --- requestAnimationFrame --- (0)
    at foo4 (<anonymous>:17:3)
    at --- queueMicrotask --- (0)
    at foo3 (<anonymous>:13:3)
    at --- setInterval --- (0)
    at foo2 (<anonymous>:6:22)
    at --- setTimeout --- (0)
    at foo1 (<anonymous>:2:3)
    at <anonymous>:50:1

Async long stack traces

Async long stack traces are the traces for async functions.

async function foo() {
  await bar();
}

Warning

The plugin adds async long stack traces only on desktop. Adding it to mobile is impossible due to the current JavaScript Engine limitations.

Async long stack traces might contain some duplicates.

When async long stack traces are enabled, the autocompletion in DevTools console stops working. It seems to be a bug in Electron.

Async long stack traces

function foo1() {
  setTimeout(foo2, 100);
}

function foo2() {
  const intervalId = setInterval(foo3, 100);
  setTimeout(() => {
    clearInterval(intervalId);
  }, 150);
}

function foo3() {
  queueMicrotask(foo4);
}

function foo4() {
  requestAnimationFrame(foo5);
}

function foo5() {
  process.nextTick(foo6);
}

function foo6() {
  setImmediate(foo7);
}

function foo7() {
  Promise.resolve().then(foo8);
}

function foo8() {
  Promise.reject(new Error('Error from Promise')).catch(foo9);
}

function foo9() {
  Promise.resolve().finally(foo10);
}

function foo10() {
  const div = createDiv();
  div.addEventListener('click', foo11);
  div.click();
}

function foo11() {
  barAsync1();
}

async function barAsync1() {
  await sleep(50);
  await barAsync2();
}

async function barAsync2() {
  await sleep(50);
  throw new Error('Error from barAsync2');
}

foo1();

Without the plugin you get the error in the console

Uncaught (in promise) Error: Error from barAsync2
    at barAsync2 (<anonymous>:58:9)
    at async barAsync1 (<anonymous>:52:3)

With the plugin you get

Uncaught (in promise) Error: Error from barAsync2
    at barAsync2 (<anonymous>:58:9)
    at async barAsync1 (<anonymous>:52:3)
    at --- async --- (0)
    at barAsync2 (<anonymous>:57:9)
    at barAsync1 (<anonymous>:52:9)
    at --- async --- (0)
    at enhance.js:1:13289
    at --- async --- (0)
    at barAsync1 (<anonymous>:51:9)
    at HTMLDivElement.foo11 (<anonymous>:47:3)
    at foo10 (<anonymous>:43:7)
    at <anonymous>
    at --- addEventListener --- (0)
    at foo10 (<anonymous>:42:7)
    at --- Promise.finally --- (0)
    at foo9 (<anonymous>:37:28)
    at --- Promise.catch --- (0)
    at foo8 (<anonymous>:33:56)
    at --- Promise.then --- (0)
    at Immediate.foo7 (<anonymous>:29:21)
    at --- setImmediate --- (0)
    at foo6 (<anonymous>:25:3)
    at --- process.nextTick --- (0)
    at foo5 (<anonymous>:21:11)
    at --- requestAnimationFrame --- (0)
    at foo4 (<anonymous>:17:3)
    at --- queueMicrotask --- (0)
    at foo3 (<anonymous>:13:3)
    at --- setInterval --- (0)
    at foo2 (<anonymous>:6:22)
    at --- setTimeout --- (0)
    at foo1 (<anonymous>:2:3)
    at <anonymous>:61:1

DevTools for mobile app

The plugin adds DevTools for the mobile app. This helps to debug the plugins without connecting mobile to the desktop.

DevTools

Debug namespaces management

Some plugins use debug library to conditionally show/hide console.debug messages.

The plugin adds an ability to manage those debug namespaces from the UI.

For more details, refer to the documentation.

Timeout long running tasks

There are some default timeouts for long running tasks. Sometimes those timeouts are being hit while you are debugging some code and staying on the breakpoint for too long.

The plugin allows to temporarily disable those timeouts to keep debugging.

Installation

The plugin is available in the official Community Plugins repository.

Beta versions

To install the latest beta release of this plugin (regardless if it is available in the official Community Plugins repository or not), follow these steps:

  1. Ensure you have the BRAT plugin installed and enabled.
  2. Click Install via BRAT.
  3. An Obsidian pop-up window should appear. In the window, click the Add plugin button once and wait a few seconds for the plugin to install.

Support

Buy Me A Coffee

My other Obsidian resources

See my other Obsidian resources.

License

© Michael Naumov