Closed chuongle closed 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
One case may trigger this problem: you are creating a collection but didn't write anything into it, this is a bug of the loki-fs-structured-adapter
and we are trying to fix it.
BTW, there's a fixed version of the adapter, but it was refactored with TypeScript.
https://github.com/recative/studio/blob/main/packages/loki-fs-structured-adapter/main.ts
@Losses Thank you for the update!!!
Today I encountered a weird issue with LokiJS. For whatever reason, the main db file (metadata) got wiped, the file is still there but the content is empty. So when the application started again, I got the
TypeError: Cannot read property 'collections' of null
error. The issue is I can catch any of these error. The only reason I am aware of this error is because I have sentry setup and it automatically caught it.Here is the code I use:
Here is the full error:
I am not sure what is going on here. Is there a right way of handling error that I am missing?