Plugin works only in the example wiki

86 views
Skip to first unread message

bimlas

unread,
Aug 27, 2018, 4:05:48 AM8/27/18
to TiddlyWikiDev
Hi!

I just created a plugin to parse Asciidoctor in TiddlyWiki:


It works but only in this wiki - when I trying to install to my own, then it prints the following error after restart:

Internal JavaScript Error
Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
Uncaught TypeError: Cannot read property 'call' of undefined


Somebody can help me to find the problem? The source code of the plugin can be found at https://gitlab.com/bimlas/tw5-asciidoctor

bimlas

unread,
Aug 27, 2018, 6:36:41 AM8/27/18
to TiddlyWikiDev
Sorry, just realized that the project was private... (-_-') Now it's available to view.

bimlas

unread,
Aug 27, 2018, 8:43:21 AM8/27/18
to TiddlyWikiDev
No, it's not finished - the problem still exists, but the source code was private.

BJ

unread,
Aug 27, 2018, 2:49:41 PM8/27/18
to TiddlyWikiDev
Hi Bimlas,
 I downloaded an empty tw from tiddlywiki.com and then dragged your plugin from https://bimlas.gitlab.io/tw5-asciidoctor/ and dropped it in the empty tw - it works ok -- in chrome 68 on xubuntu 18.04

cheers

BJ

bimlas

unread,
Aug 27, 2018, 5:24:06 PM8/27/18
to TiddlyWikiDev
Hi BJ!

Thanks for help. I tried out on Node version where it still does not working, but everything seems to be good on standalone HTML. I tried not just to restart the wiki, but restart the application from the command line: same results, the error code appears.

I don't know what causing this difference... Maybe version numbers are not the same...?

Just checked: my plugin is running on 5.1.18-prerelease (plugin is working) while empty.html (plugin is working) and Node (plugin is not working) is on 5.1.17. So it seems that the bug only appears on Node.

I cannot figure out the root of the problem, because the error messages in developer console aren't usefull (for me) and I don't know how to debug TiddlyWiki.

Any ideas?

bimlas

unread,
Aug 27, 2018, 5:43:57 PM8/27/18
to TiddlyWikiDev
Maybe I found something - I looked at the wrong place for logs: the terminal contains warning messages besides the developer console:

┌─[23:27] ~/src/tiddly-test
└─ $ tiddlywiki --init server
Copied edition 'server' to /home/nyolcas/src/tiddly-test


┌─[23:27] ~/src/tiddly-test
└─ $ tiddlywiki --server    
Serving on 127.0.0.1:8080
(press ctrl-C to exit)
 syncer
-server-filesystem: Dispatching 'save' task: $:/StoryList
For $:/
StoryList, type is application/x-tiddler hasMetaFile is false filepath is /home/nyolcas/src/tiddly-test/tiddlers/$__StoryList.tid
 filesystem
: Saved file /home/nyolcas/src/tiddly-test/tiddlers/$__StoryList.tid
 syncer
-server-filesystem: Dispatching 'save' task: $:/StoryList
 filesystem: Saved file /
home/nyolcas/src/tiddly-test/tiddlers/$__StoryList.tid
 syncer
-server-filesystem: Dispatching 'save' task: $:/StoryList
 filesystem: Saved file /
home/nyolcas/src/tiddly-test/tiddlers/$__StoryList.tid

 
# THIS IS WHERE I DROPPED THE PLUGIN IN TO THE WIKI

 syncer
-server-filesystem: Dispatching 'save' task: $:/plugins/bimlas/asciidoctor
For $:/plugins/bimlas/asciidoctor, type is application/json hasMetaFile is false filepath is /home/nyolcas/src/tiddly-test/tiddlers/$__plugins_bimlas_asciidoctor.tid
 filesystem
: Saved file /home/nyolcas/src/tiddly-test/tiddlers/$__plugins_bimlas_asciidoctor.tid

The interesting part is this:

For $:/plugins/bimlas/asciidoctor, type is application/json hasMetaFile is false filepath is /home/nyolcas/src/tiddly-test/tiddlers/$__plugins_bimlas_asciidoctor.tid

... but a similar message was shown above (with plain, newly created wiki):

For $:/StoryList, type is application/x-tiddler hasMetaFile is false filepath is /home/nyolcas/src/tiddly-test/tiddlers/$__StoryList.tid

Thus I don't think that this is a real bug - if the plain Tiddly shows the same, then it's OK. ... A plain wiki without any tiddlers... Hmm... I have to check the filelist...

Nope, the filenames and plugin.info seems to be OK (see the code at https://gitlab.com/bimlas/tw5-asciidoctor/tree/master and the tiddlers inside the plugin's contents). I compared it to the Markdown plugin (https://tiddlywiki.com/plugins/tiddlywiki/markdown/), this is what I modified to use Asciidoctor.

I don't know... Maybe it's a bug in Tiddly? What works on single HTML does not works on Node?

bimlas

unread,
Aug 27, 2018, 5:50:12 PM8/27/18
to TiddlyWikiDev
This is how I bundling the plugin (if this helps):


The tiddlers of the wiki (eg. Example) are on `gl-pages` branch, this is why I checking out it.

bimlas

unread,
Aug 27, 2018, 6:04:34 PM8/27/18
to TiddlyWikiDev
Just tried out to install Markdown plugin, it shows the same warning message on terminal:

For $:/plugins/tiddlywiki/markdown, type is application/json hasMetaFile is false filepath is /home/nyolcas/src/tiddly-test/tiddlers/$__plugins_tiddlywiki_markdown.tid

bimlas

unread,
Aug 29, 2018, 2:33:29 AM8/29/18
to TiddlyWikiDev
Found the root of the problem: Asciidoctor.js does not works without dependencies on Node. For details, see https://github.com/asciidoctor/asciidoctor.js/issues/539

BJ

unread,
Aug 29, 2018, 4:00:32 AM8/29/18
to TiddlyWikiDev
note that tiddlywiki is not like other node apps. When using tiddlywiki on node, usually this means to be running a server instance of tiddlywiki in node which is serving a client instant of tiddlywiki in the browser. The client is very similar to the standalone version of tiddlywiki. Does you parser need to work in the server and client instances of tiddlywiki?

note also that when  tiddlywiki starts it creates its own version of the 'require' functionally.

bimlas

unread,
Aug 29, 2018, 4:24:21 AM8/29/18
to TiddlyWikiDev
Thanks for help! I just solved the problem, the plugin is working on both Node and single page versions: https://groups.google.com/d/msg/tiddlywiki/PvoDxAWgziE/A0Ys8vWHAwAJ
Reply all
Reply to author
Forward
0 new messages