Closed mubaidr closed 2 years ago
Source module:
// https://www.npmjs.com/package/lowdb/v/1.0.0 import low from 'lowdb'; import FileSync from 'lowdb/adapters/FileSync'; const adapter = new FileSync('./database/db.json'); const db = low(adapter); // Set some defaults db.defaults({ bots: [], deviceDescriptors: [], userAgents: [], screenSizes: [], }).write(); export default db;
Target module:
import db from '../database/db'; console.log(db.getState());
db is defined, db.getState is defined (as per VSC). But at runtime causes following error:
db
db.getState
TypeError: db_1.default.getState is not a function
Nodejs: 18.1 LowDb: 1.0.0
Sorry, I don't know why you're getting this issue. I would suggest trying to upgrade lowdb if possible.
Source module:
Target module:
db
is defined,db.getState
is defined (as per VSC). But at runtime causes following error:Nodejs: 18.1 LowDb: 1.0.0