[tw5] LeftBar plugin and node.js server crashes

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. ($:/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’ }

1 Like

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.

<:-)

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.

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:

Aha, thank you @joshuafontany and jn.pierr…
So, do I understand right that this is resolved in the upcoming 5.2?
Thanks
<:-)

1 Like

I see it was reported and fixed by fellow @joshuafontany here.
Mucho thanko!
<:-)

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!