TypeError: tree is undefined when using markdown plugin

100 views
Skip to first unread message

Adrian Goins

unread,
Apr 26, 2016, 5:16:50 PM4/26/16
to TiddlyWiki
Howdy, all. I'm really excited about TW, and I started working with it this morning. I'd like to compose in Markdown, since I use it in a number of other places and am very comfortable with it. The markdown plugin works great, but when I re-open the wiki and create a new document and set the content type to "Markdown (text/x-markdown)," I get a big nasty red popup that says "TypeError: tree is undefined." Restarting has no effect. I've uninstalled and reinstalled the plugin, started a new wiki, and done everything I can think of. This error returns consistently.

This seems to be connected to the Markdown plugin, since the error only appears when setting the content type. I'm unable to find anything about it anywhere online, so maybe I'm just overlooking something simple?

Thanks in advance for any guidance.

Adrian

Auto Generated Inline Image 1

BJ

unread,
Apr 27, 2016, 7:22:57 AM4/27/16
to TiddlyWiki
Hi Adrian,
I would like to reproduce this problem and need some info -
what version of tiddlywiki is this? (the version is displayed in the info tab of the control panel - got to by click the 'cog' icon on the right - or alternatively place <<version>> in a tiddler)
what browser (and version) are you usings
where did you get the markdown plugin from?

cheers
BJ

Adrian Goins

unread,
Apr 27, 2016, 9:33:40 AM4/27/16
to tiddl...@googlegroups.com
Hi, BJ. Thanks for the interest.

  • Version 5.1.11
  • Firefox 45.0.2, though it also appears with TiddlyDesktop
  • I installed the plugin from the Official TiddlyWiki Plugin Library (ControlPanel / Plugins / Get more plugins)

I can reproduce and workaround the bug with the following steps in the browser:

  • Create new Tiddler by clicking on link to nonexistent Tiddler
  • Set type to markdown
  • Error appears
  • Set type to TiddlyWiki 5
  • Save Tiddler (Wiki also saves at this point)
  • Edit Tiddler
  • Set type to markdown
  • Error appears
  • Cancel
  • Close window (just the window, not the whole browser)
  • Re-open window
  • Re-load TW file from bookmark
  • Edit Tiddler
  • Set type to markdown
  • Error does _not_ appear
  • Continue editing in markdown

[EDIT] - I was just going through these steps again, and it appears to be even easier. The error only appears if there is no text in the edit window. If I have text there (anything at all), it allows me to set the type to markdown without error. I've been setting the type first, so that when I start typing, the preview window shows the content correctly.


Please let me know what else I can do to help (record video, try various things, etc). I'm a sysadmin with 20y experience mucking about with stuff, so if you need me to edit JS in the console or enable debugging or anything, I'm happy to do so. Just send me instructions.

BJ

unread,
Apr 27, 2016, 12:13:02 PM4/27/16
to TiddlyWiki
Good stuff, you have uncovered a bug in the navigator widget. (it initiates the creation/editing of tiddlers) When you create a new tiddler by editing the 'phantom' tiddler (shown as 'missing' in the story) the navigator assumes that the tiddler already exists. It should check and if it does not exist initialise the 'draft of' tiddler with an empty string.

What you see is the result of the preview with a undefined content - the 'undefined' is given to the markdown extension, which then fails.

If you like you can report it as a bug on github (if you have a github account), otherwise I will open a bug.

All the best

BJ

Adrian Goins

unread,
Apr 28, 2016, 8:05:18 AM4/28/16
to TiddlyWiki
I do have a github account, but it sounds like you have more information to describe the bug. I would just copy/paste the bulk of our conversation. If you would post the bug, I think that would be better.

Thanks!


BJ

unread,
Apr 29, 2016, 11:07:58 AM4/29/16
to TiddlyWiki
Reply all
Reply to author
Forward
0 new messages