numbereself / caracAL

Node client for adventure.land

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Local storage issue - storage.json 0 bytes

SSzretter opened this issue · comments

commented

Hello, I have not been able to track it down yet but there is an issue where the storage.json file ends up at 0 bytes and then when main.js script launches it stops because of unexpected end of JSON input:

node main.js
config file exists. lets get started!
failed to start caracAL Error: SyntaxError: Unexpected end of JSON input
at Function.set (G:\My Drive\VisualStudio\OTHER\caracAL\node_modules\json-storage-fs\index.js:48:19)
at G:\My Drive\VisualStudio\OTHER\caracAL\main.js:44:16

It does not happen every time - sometimes it creates the file properly and I can control-c and re-start the script multiple times without issue. But sometimes it randomly will not start, almost like the file is getting cleared out while running or maybe its because of the control-c. In which case is there a recommended way to shutting it down?

Yeee, this keeps happening for some reason.
Its an issue with json-storage-fs.
If you put {} into the file itll work.
IMO I need to replace that library.

And by the file I mean the file inside the localStorage folder where we put the localStorage things

I just added a workaround as of 8f3480c , which essentially does what I described above.
Update by running git pull