vogler / free-games-claimer

Automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG.
GNU Affero General Public License v3.0
2.58k stars 155 forks source link

Broken update to lowdb #389

Open JP-Garcia opened 1 month ago

JP-Garcia commented 1 month ago

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: https://github.com/typicode/lowdb/issues/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);
vogler commented 1 month ago

What update? Last update to lowdb was 4 months ago and it's been working fine for me since then: https://github.com/vogler/free-games-claimer/commit/f0f142733e0fd7e365a239fbc8d737a70a739cbc Did you forget to npm install to get the correct version?

JP-Garcia commented 1 month ago

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 😶‍🌫️.