I followed the tutorial from https://tiddlywiki.com/#tiddlywiki.files%20Files to import a folder of PDFs. This is the content of my tiddlywiki.files
file:
{
"directories": [
{
"path": "../../files",
"filesRegExp": "^.*\\.pdf$",
"isTiddlerFile": false,
"fields": {
"title": {"source": "basename-uri-decoded", "prefix": "files/"},
"created": {"source": "created"},
"modified": {"source": "modified"},
"type": "application/pdf",
"tags": ["Source", "PDF"],
"medium": "pdf",
"text": "",
"_canonical_uri": {"source": "filename", "prefix": "files/"}
}
}
]
}
However, when I start the node server (using TW version 5.2.0), I got the following error message in console:
C:\Users\Pak\AppData\Roaming\npm\node_modules\tiddlywiki\boot\boot.js:1903
value = $tw.utils.decodeURIComponentSafe(path.basename(filename,path.extname(filename)));
^
TypeError: $tw.utils.decodeURIComponentSafe is not a function
at C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:1903:26
at Object.$tw.utils.each (C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:135:12)
at C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:1887:14
at Object.$tw.utils.each (C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:126:12)
at processFile (C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:1886:13)
at C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:1960:7
at Object.$tw.utils.each (C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:126:12)
at Object.$tw.loadTiddlersFromSpecification (C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:1943:12)
at Object.$tw.loadTiddlersFromPath (C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:1847:45)
at C:\Users\Pak\AppData\Roaming\npm\node_modules\←[4mtiddlywiki←[24m\boot\boot.js:1852:40
I believe the cause is due to the line "title": {"source": "basename-uri-decoded",...
since when I change from basename-uri-decoded
to basename
or filename
then everything works fine and I see the imported PDFs. But when I use xxxx-uri-decoded
then the server doesn’t start and I got the above error message in console.
Does anyone else have this problem? Is it just my computer or is it really a bug?