Tag-tree-picker-macro fails

I like to have a separate plugin folder.
But I may try another serever just to see If I got it working withthat method.
My node version is v12.22.9
I see that Latest Current Version: 21.5.0 (includes npm 10.2.4)
Strange. The one I have is whats from the official repos.

Upinstalled and installed from script and upgraded
Now the error from tiddlewiki says:

Error executing boot module $:/plugins/linonetwo/tag-tree-picker-macro/tagTreeMacro.js: SyntaxError: Unexpected token ':'
                                                                                                                                                                                             
$:/plugins/linonetwo/tag-tree-picker-macro/tagTreeMacro.js:52                                                                                                                                 
function buildTocWithOfferedTiddlers(rootTiddler: string, offeredTiddlers: string[]): string {                                                                                                
                                               ^

Linux? The repos for node.js lag way behind. You pretty much have to use your own self-installed node if you’re using the latest features.

I did. i now have 20.10.0

Oh. I could be wrong. But I think that’s Typescript. So I think you would have to add Typescript to your node implementation.

Installed typescript. Still

Error executing boot module $:/plugins/linonetwo/tag-tree-picker-macro/tagTreeMacro.js: SyntaxError: I dotUnexpected token '

I dont even have tag-tree-picker-macro/tagTreeMacro.js or plugins/linonet in my system.

After checking out the code for the plugin have you built it by running npm run build in the directory with the plugin code?

Also pinging @linonetwo in case that doesn’t do the trick. What is the recommended way to install the plugin from source?

The chinese github at end of README.md tellst to use npm for thier install . But their plugint does another job (AFAIK).
The one that I i linked to in topic have downloadable relase 1.0.0 .

I think if you do npm i in the root directory ( the one with package.json) it will install typescript. Typescript is listed as one of the dependencies. You can look at package.json to see all the dependencies needed. I don’t know if it installs the dependencies globally, or if other steps will be needed. It’s been awhile since I’ve used node.js (except for stock Tiddlywiki).

It would be much easier to just grab the plugin from their demo :wink:

I am thankful for you giving this time,
Folowed your advice. Stilll same problem.

I’m not clear what you are doing using cli, but I recognize Unexpected token '?' on ?? means your browser or nodejs might be outdated. (You can ask GPT for this error, really).

I recommend at least node 18, or TidGi app which use electron with latest nodejs.

Usually you can follow the step in Github Action, using same nodejs version as it, and follow the step it does, you can get the plugin compiled form source.

This is not recommended for most of users, because they will encounter error and rising issues. So we make and recommend CPL to reduce QA pressures.

But if you are a web developer then this is not the case, you can try steps in .github/workflows/release.yml and you will get a dist folder that can be renamed and drag to your plugins folder.

I was told that from Mark_S a few hours ago. So I updated to, 20.10.0 . He also mentioned that I should install Typescript, which I did . The error is pretty much the same…

See Design Challenge simple AND, OR NOT conditions in filters - #3 by linonetwo for example about Nullish coalescing operator (??) in filter expression.

This should work

截屏2023-12-29 12.15.58

But I’m using compiled js, which don’t have ??. maybe you should compile it correctly too.

I am comfortable with linux shell and enviornment variables and have set

export TIDDLYWIKI_PLUGIN_PATH=$HOME/Where/IWant/It/To/Be 

So I don’t believe that should be a problem.

Even thought that, I have one installpath for tiddlywiki which I reinstall each time only for test. My script that starts that tiddllywiki sets TIDDLYWIKI_PLUGIN_PATH= (empty) just in case to not confuse anything.

I am no developer, but I have some years with linux shell :slight_smile: and have spent way to much time with scripting for bash.
fSo I don’t believe that should be a problem.
But I am a noob when it comes to code anything based on html/css/javasctipt .

Purged package managers version and installed last stable , which is 20.10.0.

I was wrong about this, seems latest version of tiddlywiki-plugin-dev build will only produce json file

But you can try manually use tsc to compile src/tag-tree-picker-macro/tagTreeMacro.ts to .js file. And rename src/tag-tree-picker-macro/tagTreeMacro.ts.meta to .js.meta, then it is fine.

I’m not familiar with using tsc manually without framework, but GPT will help you with this.

Thank you. I will try that.