typicode/lowdb

Example from docs not working in react, PLEASE HELP...

sahilrajput03 opened this issue · 2 comments

I used code from https://github.com/typicode/lowdb/tree/main/examples#browser
Link to code: github.com/sahilrajput03/lowdb-not-working

Please help to assist in this issue.. , thanks in advance!

image

image

I fixed this by adding some config for fs and path and now its working: https://github.com/sahilrajput03/lowdb-not-working/tree/fixed

npm i -D react-app-rewired path-browserify

You can see the diff of the commit here.

i have a similar issue.

"react-scripts": "3.4.0",
"lowdb": "^3.0.0",
import { LocalStorage, LowSync } from 'lowdb/lib';

const productsJSON = require('../data/products.json');

const adapter = new LocalStorage('db');

error

./node_modules/lowdb/lib/adapters/TextFile.js
Module not found: Can't resolve 'steno' in '.../node_modules/lowdb/lib/adapters'

Any ideas?