felixhayashi / TW5-TiddlyMap

Map drawing and topic visualization for your wiki
http://tiddlymap.org
BSD 2-Clause "Simplified" License
845 stars 127 forks source link

plugin fails to load after tiddlywiki upgrade to 5.3 #450

Closed ssow closed 1 year ago

ssow commented 1 year ago

Hi,

It seems that there is an issue with tiddlymap plugins after upgrading to tiddlywiki 5.3. The following error is printed when starting nodejs

tiddlywiki[21557]: Error executing boot module $:/plugins/felixhayashi/vis/vis.js: "Global assignment is not allowed within modules on node."

Any clue regarding how to fix this issue ?

Thank you

flibbles commented 1 year ago

Have you upgraded to the latest version of vis-network? That should fix the issue.

ssow commented 1 year ago

I'm unable to upgrade as the instance does not start :-)

flibbles commented 1 year ago

So this is happening in a standalone tiddlywiki file?

ssow commented 1 year ago

It's a nodejs installation.

flibbles commented 1 year ago

Right. You did say nodejs. My listening skills are poor.

If you're installing your plugins through the browser, you must have all your plugins in a "plugin" directory off your root dir? Is that correct?

ssow commented 1 year ago

yes. The plugins files are actually stored in the root directory and renamed (pathname included)

flibbles commented 1 year ago

All right, I think I figured this out.

  1. Download the vis-network json file from here.
  2. On the command line, cd to the root directory of your project, and then type:
    • tiddlywiki --import <path/to/that/file.json> application/json ...where <path/to/that/file.json> is probably something like ~/Downloads/vis-network.json

That should sort you out. Sorry you have to go through this. Tiddlywiki V5.3.0 has suddenly decided to disallow Global assignment in nodejs, which is something that the vis-network relied on. The new version has a workaround for this.

Edit: corrected application/son to be application/json

flibbles commented 1 year ago

Crap. That's not going to work, is it? The command line won't even run because of this issue.

Let me think about this.

ssow commented 1 year ago

It does not work as the program stopped during loading :-) I need to remove the plugins manually, i guess.

flibbles commented 1 year ago

Okay, I think I figured it out.

  1. Yes, remove the old vis-network plugin manually like you said.
  2. You can put that vis-network.json file directly into your <root>/tiddlers directory. That appears to make it load as a plugin, and while it's not a perfect place for it, this will at least allow you to load up your tiddlywiki.
flibbles commented 1 year ago

But you should only need to remove the vis-network plugin, which should be in your <root>/plugins directory, I think, depending on how you installed.

ssow commented 1 year ago

I've removed all \$__pluginsfelixhayashi* files and the instance is online. I guess it would be wise to add a "safe mode" flag to tiddlywiki nodejs which disables plugins loading :-)

Thank you very much for your help.

Sincerely

flibbles commented 1 year ago

Sorry you had to fully uninstall TiddlyMap to get back online. If you upgrade to the latest versions of TMap and its dependencies, everything should be functional again.

Edit: Which, by the way, can be found here

ssow commented 1 year ago

No worries. I've learnt something from the experience.