zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.19k stars 230 forks source link

HOW-TO: Mindmap Generation Script (Excalidraw Automate) Fails to Generate Mindmap from Outline #2025

Closed Aulline closed 1 month ago

Aulline commented 1 month ago

Have you searched for existing issues (including closed ones)?

Does this bug persist in a new vault with only Excalidraw installed?

Your environment

SYSTEM INFO: Obsidian version: v1.6.7 Installer version: v1.6.7 Operating system: Windows 11 Home 10.0.22631 Login status: not logged in Insider build toggle: off Live preview: on Base theme: adapt to system Community theme: none Snippets enabled: 0 Restricted mode: off Plugins installed: 2 Plugins enabled: 2 1: Templater v2.7.1 2: Excalidraw v2.5.0

RECOMMENDATIONS: Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the bug

The mindmap script (https://zsviczian.github.io/obsidian-excalidraw-plugin/Examples/templater_mindmap.html) will not generate a mindmap. Instead, an error is thrown:

plugin:templater-obsidian:61 Templater Error: Template parsing error, aborting. 
 Cannot read properties of null (reading '1')
log_error @ plugin:templater-obsidian:61

Steps to reproduce

  1. Create an MD file and paste the example input from the link above
  2. Select example input and run the templater script from the link above

Expected behavior

Mindmap is generated

Additional context

No response

zsviczian commented 1 month ago

Don't jump to conclusions about bugs :) This is a how to question. I tested the script and it works as described. I recommend adding debugger; in the code, opening the Developer Console (CTRL+SHIFT+i / CMD+OPT+i) and observing what happens.

The most typical issue is that the script was not designed with any error tolerance as for the input file. Make sure you have no empty line at the end of the input file.

Notice there is no empty line after Test 3.1

Here's the successful run just now:

image
Aulline commented 1 month ago

Oh yeah you are right, I finally managed to execute it. Indeed, there should be no empty lines before/after the input (and no frontmatter). Thanks for helping!