LeftBar plugin and node.js server crashes

56 views
Skip to first unread message

Jean-Pierre Rivière

unread,
Sep 27, 2021, 9:21:28 AMSep 27
to TiddlyWiki

I’ve encountered a problem with the LeftBar plugin (v2.1.4). It happens on a brand new empty server edition on node.js (linux arm64, run through docker) where:

  • I create a $:/config/FileSystemPaths tiddler whose sole content is [!is[system]slugify[]] (not interesting but deliberately very reduced)
  • I then quit the server and import my plugin with
tiddlywiki mywiki --load plugin.json

Now’ I start again the server. This sandwich icon of LeftBar is or the upper left corner. 

Then I click on that sandwich icon for LeftBar and the server crashes. See below:


=====
syncer-server-filesystem: Dispatching 'save' task: $:/plugins/TWaddle/LeftBar/temp node:internal/fs/utils:879 throw new ERR_INVALID_ARG_TYPE( ^ TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined at Object.writeFile (node:fs:2106:5) at Object.exports.saveTiddlerToFile ($:/core/modules/utils/filesystem.js:414:6) at $:/plugins/tiddlywiki/filesystem/filesystemadaptor.js:85:13 at FileSystemAdaptor.getTiddlerFileInfo ($:/plugins/tiddlywiki/filesystem/filesystemadaptor.js:72:2) at FileSystemAdaptor.saveTiddler ($:/plugins/tiddlywiki/filesystem/filesystemadaptor.js:81:7) at SaveTiddlerTask.run ($:/core/modules/syncer.js:597:27) at Syncer.processTaskQueue ($:/core/modules/syncer.js:503:9) at Function.<anonymous> ($:/core/modules/syncer.js:90:9) at $tw.Wiki.exports.dispatchEvent ($:/core/modules/wiki.js:133:13) at $:/core/modules/wiki.js:166:10 { code: 'ERR_INVALID_ARG_TYPE' }
=====
 

I suppose my plugin is not correctly installed. So I was about to do it the proper way with tiddlywiki --build index and after having set the TIDDLYWIKI_PLUGIN_PATH environment variable. But there is a problem: I don’t know how to get all the individual tiddlers of the plugin. The plugin shows its shadow tiddlers, which I can export. But what for the core of the plugin, actual code? I have not been able to get any source code repository for LeftBar.

My questions:

  • is my diagnostic of the crash correct (bad installation of the plugin)?
  • how could I get all of the files of a plugin given its json file?
Thank you for your help!

Mat

unread,
Sep 27, 2021, 12:37:37 PMSep 27
to TiddlyWiki
Hi jn.pierr I am the author of LeftBar. You really timed your question because I have barely passed by here for a few months now. Unfortunately I can't really answer your question. I only create wikitext plugins and in vanilla TW and the link I gave is the actual source for the plugin. You obviously use nodejs so I'm afraid I don't have any idea what might cause the error or how to resolve it.

With that said, it is not a very complicated construction. And it is likely to be considered a hack because I'm not a real coder. You see the plugin "files", really its shadow tiddlers, just like for any plugin - i.e in the TW Ctrlpanel, click the plugin and see its contents tab. To a great extent, the plugin functions by setting CSS values for the TW native page layout values. The actual menu is a tiddler forced to sit up in the left corner.

<:-)

Jean-Pierre Rivière

unread,
Sep 27, 2021, 1:37:45 PMSep 27
to TiddlyWiki
Hi Matt. Thank you for being there today!

At last, I know there is no hidden javascript to look for. This will help me search after the culprit.

Jean-Pierre Rivière

unread,
Sep 28, 2021, 1:50:44 AMSep 28
to TiddlyWiki
The origin of the crash has ben found by @joshuafontany in an other thread on tiddlytalk, that I paste here for any reader to know it:

====
You have run into a bug in 5.1.23 and earlier that would crash the server trying to write a tiddler with no text field. This happens rarely, but most often when an $action-setfield widget sets a NON-text field on a non-existent tiddler (this creating it without a text field).

The button in the plugin sets a temp tiddler’s NON-text fields, and that is when the crash is happening. I would recommend using the pre-release on node.
====

Mat

unread,
Sep 28, 2021, 8:45:22 AMSep 28
to TiddlyWiki
Aha, thank you @joshuafontany and jn.pierr...
So, do I understand right that this is resolved in the upcoming 5.2?
Thanks
<:-)

Mat

unread,
Sep 28, 2021, 10:05:20 AMSep 28
to TiddlyWiki
I see it was reported and fixed by fellow @joshuafontany here.
Mucho thanko!
<:-)

Jean-Pierre Rivière

unread,
Oct 22, 2021, 5:25:04 AMOct 22
to TiddlyWiki
Yes, alas for me, I am left with both 5.1.23 and 5.2.0 failing my project:

* 5.1.23 because of this very bug (which is occurring eleswhere for my project);
* 5.2.0 because jsonmangler is not able to operate on it as of yet.

I have to stick to 5.1.23 because of json. I will try to adapt my code to adapt this bug (first create a non-typed tiddler then update it with a set type) until 5.2.0 become json friendly. So' thank you @Mat for spotting and reporting this bug report!

Reply all
Reply to author
Forward
0 new messages