Problem exporting a complete TiddlyWiki as a website

I have a complete workoing TW in Node.js which I want to export as a static site on the web.

I have tried following the instructions here https://nesslabs.com/tiddlywiki-static-website-generator (and the actual commands are the same as on https://tiddlywiki.com/)

The first step runs OK and creates html files for each tiddler in the output folder.
When I run the second command:
tiddlywiki --rendertiddler $:/core/templates/static.template.html static.html text/plain

I get a string of errors:

$:/plugins/felixhayashi/tiddlymap/js/widget/MapWidget:11
/* @preserve TW-Guard */var MapWidget=function(e){_inherits(t,e);function t(e,i){_classCallCheck(this,t);var a=_possibleConstructorReturn(this,(t.proto||Object.getPrototypeOf(t)).call(this,e,i));a.getAttr=a.getAttribute;a.isDebug=_utils2.default.isTrue($tm.config.sys.debug,false);_utils2.default.bindTo(a,[“constructTooltip”,“handleResizeEvent”,“handleClickEvent”,“handleCanvasKeyup”,“handleCanvasKeydown”,“handleCanvasScroll”,“handleCanvasMouseMove”,“handleWidgetKeyup”,“handleWidgetKeydown” …

y:“addGraphButtons”,value:function e(t){var i=_utils2.default.getFirstElementByClassName(“vis-navigation”,this.domNode);for(var a in t){var s=this.document.createElement(“div”);s.className=“vis-button tmap-”+a;s.addEventListener(“click”,t[a].bind(this),false);i.appendChild(s);this.setGraphButtonEnabled(a,true)}}}]);return t}(_widget.widget);exports.tmap=MapWidget;exports.tiddlymap=MapWidget;
^

ReferenceError: $tm is not defined
at new t ($:/plugins/felixhayashi/tiddlymap/js/widget/MapWidget:11:258)
at ElementWidget.Widget.makeChildWidget ($:/core/modules/widgets/widget.js:403:9)
at $:/core/modules/widgets/widget.js:373:27
at Object.$tw.utils.each ($:/boot/boot.js:146:12)
at ElementWidget.Widget.makeChildWidgets ($:/core/modules/widgets/widget.js:372:12)
at ElementWidget.render ($:/core/modules/widgets/element.js:66:7)
at ElementWidget.Widget.renderChildren ($:/core/modules/widgets/widget.js:442:15)
at ElementWidget.render ($:/core/modules/widgets/element.js:71:7)
at SetWidget.Widget.renderChildren ($:/core/modules/widgets/widget.js:442:15)
at SetWidget.render ($:/core/modules/widgets/set.js:33:7)

Advice please.

How is the tiddlymap plugin installed? I’m thinking you might have to include the plugin path as mentioned here

On my local version, like any other plugin - it appears in the plugin list in the Control Panel.

Hi @myfta it sounds like TiddlyMap’s “map” widget does not support rendering static HTML snapshots on the server.

It would be feasible to get it running under Node.js. We would need a JS library that polyfills the “canvas” element that is used for rendering in the browser.

So are there other options for putting a node.js TW onto the web? i.e. a dynamic version. If so, can you point me in the right direction.

Thanks.

Just for completeness you can save a nodeJS version of tiddlywiki as a “single file wiki” and put that online, just one HTML file plus external media etc… Depending on the total size you may want to add;

  • A splash screen while loading
  • Optimise your wiki for performance
  • Your site on a CDN like cloudflare
  • You can get the ability to save with tw-receiver on an apache host

And other host node within

  • Docker containers
  • Behind proxies
  • and more I am sure