TiddlyWiki Node.js : how to include single tiddlers stored in external files outside of wiki directory?

Is the tiddlywiki.files mechanism the correct way of doing it?

I have a wiki in /data/data/com.termux/files/home/tiddlywiki/test and a /data/data/com.termux/files/home/tiddlywiki/test/tiddlers/tiddlywiki.files file with the following content:

{
    "tiddlers": [
    {
        "file": "/data/data/com.termux/files/home/work/test/tiddlers/HelloWorld.tid",
        "fields": {
            "title": "HelloWorld",
            "type": "text/vnd.tiddlywiki"
          },
    }
    {
        "file": "/data/data/com.termux/files/home/work/test/tiddlers/helloworld.js",
        "fields": {
            "title": "helloworld.js",
            "type": "application/javascript",
            "module-type": "macro"
          }
    }
  ]
}



When I start TiddlyWiki from Termux console and open the browser, the tiddlers don’t show up.

I personally have not used the tiddlywiki.files yet, however, your JSON is missing a comma between the two tiddlers which could be causing your problem.

{
    "tiddlers": [
    {
        "file": "/data/data/com.termux/files/home/work/test/tiddlers/HelloWorld.tid",
        "fields": {
            "title": "HelloWorld",
            "type": "text/vnd.tiddlywiki"
          }, <----- remove unnecessary comma
    }, <------ add comma
    {
        "file": "/data/data/com.termux/files/home/work/test/tiddlers/helloworld.js",
        "fields": {
            "title": "helloworld.js",
            "type": "application/javascript",
            "module-type": "macro"
          }
    }
  ]
}

Incredible how many times I looked at the screen and didn’t see it :man_facepalming:

I shall install a JSON linter.

Yet, can TiddlyWiki display a notification about invalid JSON files? Or write an error message to stdout/a log file?

I tried to add --verbose when I did tiddlywiki test --listen, but I don’t think I saw anything. Was the verbosity level not high enough? Did TiddlyWiki just silently discard it? Of course this is not a rant, I fully acknowledge my mistake.

You can use vscode for JSON linting.

I think it should log error, you can read the boot.js of tw core and find if there is a try-catch around JSON parse, and discard the error instead of console.error it.