Skip to content
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

fixed error with lowdb #390

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fixed error with lowdb #390

wants to merge 1 commit into from

Conversation

JP-Garcia
Copy link

Fixes #389

@biast12
Copy link

biast12 commented Nov 13, 2024

Just tested it and it works

@vogler
Copy link
Owner

vogler commented Nov 13, 2024

What is this for? Wasn't #380 just due to a missing npm install?

@biast12
Copy link

biast12 commented Nov 13, 2024

Ohh idk about that issue or the original issue tbh, but it's giving an error for me when running something like unrealengine.js SyntaxError: Unexpected token '', ""... is not valid JSON
image

And this PR seems to have fixed that error

@vogler
Copy link
Owner

vogler commented Dec 30, 2024

@biast12 Likely your unrealengine.json contains ' instead of " for quoting strings which is why JSONFile.parse from JSONFilePreset fails. You can check if it is valid JSON here: https://jsonlint.com
Why this is not the case with the old API, I don't know. Would be strange if JSONFileSync.parse is more lenient.
Looking at https://github.com/typicode/lowdb, it should be equivalent, but using the presets is nicer if no custom serialization is needed.

This PR also changes jsonDb from async to sync, so the await at all call-sites should be removed.

@biast12
Copy link

biast12 commented Dec 30, 2024

Mmmmm that's weird, i haven't edited the .json file, and i assume the program would use "", also when i checked did it use "" but i might have deleted the old .json file so idk

Tho i have just noticed a whole other issue, i'm getting a constant "One More Step" cloudflare security check which won't allow me to continue at all, and idea how to fix it?
image

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

Successfully merging this pull request may close these issues.

Broken update to lowdb
3 participants