OokTech / TW5-Bob

A plugin that makes tiddlywiki a multi-user wiki on node
BSD 3-Clause "New" or "Revised" License
216 stars 28 forks source link

WebSocket error: TypeError: Cannot read property 'fields' of undefined #120

Closed joshuafontany closed 1 year ago

joshuafontany commented 4 years ago
joshu@Enyo MINGW64 /d/tw
$ /d/tw/bobdev.sh
NodeSettings - Parsed raw settings.
Added route /^\/Bookmarks\/?$/
Added route /^\/Dev\/?$/     
Added route /^\/Formulas\/?$/
Added route /^\/JsonMangler\/?$/
Added route /^\/JsonEditor\/?$/
Added route /^\/IoM\/?$/
Added route /^\/TekanBoards\/?$/
Added route /^\/joshuafontany.github.io\/?$/
Added route /^\/Thule\/?$/
Added route /^\/Tiddlymap\/?$/
Added route /^\/West Premium Rockaway\/?$/
TiddlyWiki version 5.1.22-prerelease with Bob version 1.4.0
Bob saver server running on 127.0.0.1:61192
Serving on 127.0.0.1:8080
(press ctrl-C to exit)
new connection
WebSocket error:  TypeError: Cannot read property 'fields' of undefined
WebSocket error:  TypeError: Cannot read property 'fields' of undefined
WebSocket error:  TypeError: Cannot read property 'fields' of undefined
WebSocket error:  TypeError: Cannot read property 'fields' of undefined
WebSocket error:  TypeError: Cannot read property 'fields' of undefined
WebSocket error:  TypeError: Cannot read property 'fields' of undefined
WebSocket error:  TypeError: Cannot read property 'fields' of undefined
WebSocket error:  TypeError: Cannot read property 'fields' of undefined

This was debuged and traced to NodeServerHandler.js line 342, where the server is trying to load $:/plugins/OokTech/Bob/ExcludeSync.

It seems that if Bob is not explicitly declared in the wiki's plugins list (even if the wserver setting servePlugin is true), then Bob's tiddlers do not appear in either the tiddlers[] or the shadowTiddlers[] array indexes when $tw.Bob.Wikis[data.wiki].wiki.getTiddler() is called.

This may be due to recent changes in TW5.1.22-pre indexing (??). I'm not 100% sure if this is causing save/load failures, but I seem to have lost data due to this...

Temp fix: Include Bob in the plugin list for each individual wiki.

Best, Joshua Fontany


I am running (check any that apply, put an x inside the [ ] to check a box, like this: [x]):

and using

Before posting I read issue guidelines and:

inmysocks commented 4 years ago

Thank you for this. I haven't been able to investigate the interaction between bob and the new changes to the core. I expect that this will be interesting. For now I advise against using TW5.1.22 with bob until we get a chance to properly update Bob to work with the new changes.

inmysocks commented 4 years ago

I have been testing bob with the 5.1.22 prerelease and I fixed a few errors, I haven't run into what you are describing but it may have been changed since you tried this. I will continue to test.

joshuafontany commented 4 years ago

I have not seen this recently either (I'm tracking your master and dev branches and keeping my local repo as up to date as possible). I also moved all of my tiddlywiki data to my logical 'C:' drive instead of 'D:' (the other big change to my setup, which I mention because that cleared up other weirdness).

Best, Joshua F

AnthonyMuscio commented 4 years ago

I am using TiddlyWiki version 5.1.22 with Bob version 1.5.2

After a new connection, selecting a WIki in my browser I get

new connection
No Themes Folder C:\Data\TW5\!TW-Tools\Themes
No Themes Folder C:\Data\TW5\!TW-Tools\Themes
No Languages Folder C:\Data\TW5\!TW-Tools\Languages
WebSocket error:  Error: ENOENT: no such file or directory, scandir 'C:\Data\TW5\!TW-Tools\Editions'
No Themes Folder C:\Data\TW5\!TW-Tools\Themes
No Themes Folder C:\Data\TW5\!TW-Tools\Themes
No Languages Folder C:\Data\TW5\!TW-Tools\Languages

If I edit a tiddler in a wiki it remain locked, and cant be edited.

Closing Bobexe window, re-execute and reconnect the wiki it will save.

Regards Tony

inmysocks commented 4 years ago

@AnthonyMuscio if you have a new issue start a new issue, don't post unrelated things on an existing thread.

amreus commented 3 years ago

I am seeing this in 1.6.2r2

inmysocks commented 3 years ago

@amreus is including Bob in the tiddlywiki.info file fixing it for you like @joshuafontany mentioned? I need to look into his pull request, I am behind on managing this.