How to debug Javascript snippet in Obsidian?

Hi,

I am very interested in learning how to debug JavaScript snippets of DataviewJS or Templater, but I am not sure how to get started. While I have some beginner knowledge of JavaScript, I have no experience with the console.

Here are my questions:

  • Do you have any tips on how to get started?
  • When I look at the Obsidian console, I see error messages like this: image
    but I don’t understand them.
  • Is it possible to set breakpoints in a Templater or DataviewJS snippet? With this, I could at least identify the location where the code has an error.

Thank you in advance,
Silias

1 Like