Skip to content

DatabaseError: Can't Load Database #844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
doktor500 opened this issue Jul 12, 2024 · 2 comments
Closed

DatabaseError: Can't Load Database #844

doktor500 opened this issue Jul 12, 2024 · 2 comments
Labels

Comments

@doktor500
Copy link

I saw this issue but this is currently happening to me using "node-json-db": "^2.3.0"

DatabaseError: Can't Load Database
 ❯ JsonDB.load ../../../../node_modules/node-json-db/src/JsonDB.ts:413:19
 ❯ JsonDB.retrieveData ../../../../node_modules/node-json-db/src/JsonDB.ts:51:9
 ❯ JsonDB.getParentData ../../../../node_modules/node-json-db/src/JsonDB.ts:134:13
 ❯ ../../../../node_modules/node-json-db/src/JsonDB.ts:329:28
 ❯ lock.writeLock ../../../../node_modules/node-json-db/src/lock/Lock.ts:51:32
@Alastor-git
Copy link

I'm encountering the same issue on version 2.3.0.

Steps to reproduce the error :

  • Create a database file that's empty
  • Attempt to push to the database
  • You'll get an error.

It works with no file :

  • Remove the file
  • Attempt to push to the database
  • It works.

It works with empty object :

  • Create file with an empty object
  • Attempt to push to the database
  • It works.

Expected behavior :
The case with an empty file should behave the same as when there is no file.

@Belphemur Belphemur added the bug label Jan 23, 2025
github-actions bot pushed a commit that referenced this issue Jan 23, 2025
## [2.3.1](v2.3.0...v2.3.1) (2025-01-23)

### Bug Fixes

* override empty file ([024169f](024169f)), closes [#844](#844)
@Belphemur
Copy link
Owner

@Alastor-git That a good point.

Fixed in v2.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants