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

Broken update to lowdb #389

Open
JP-Garcia opened this issue Oct 1, 2024 · 2 comments · May be fixed by #390
Open

Broken update to lowdb #389

JP-Garcia opened this issue Oct 1, 2024 · 2 comments · May be fixed by #390

Comments

@JP-Garcia
Copy link

Getting this error after pulling changes today:

file:///D:/Dev/free-games-claimer/src/util.js:14
import { JSONFilePreset } from 'lowdb/node';
         ^^^^^^^^^^^^^^
SyntaxError: The requested module 'lowdb/node' does not provide an export named 'JSONFilePreset'

Screenshot 2024-09-30 194638

Saw the same problem here:
typicode/lowdb#554

This change in src/util.js fixed it for me:

import { LowSync } from "lowdb";
import { JSONFileSync } from "lowdb/node";
export const jsonDb = (file, defaultData) => new LowSync(new JSONFileSync(dataDir(file)), defaultData);
@JP-Garcia JP-Garcia linked a pull request Oct 1, 2024 that will close this issue
@vogler
Copy link
Owner

vogler commented Oct 1, 2024

What update? Last update to lowdb was 4 months ago and it's been working fine for me since then: f0f1427
Did you forget to npm install to get the correct version?

@JP-Garcia
Copy link
Author

Haha you're right, and its been almost a year since I pulled changes. I don't like messing with npm so I didn't even look 😶‍🌫️.

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

Successfully merging a pull request may close this issue.

2 participants