Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Error: Cannot find module './bunq-js-client-data.json' #65

Open
dodgekaze opened this issue Sep 23, 2020 · 2 comments
Open

Error: Cannot find module './bunq-js-client-data.json' #65

dodgekaze opened this issue Sep 23, 2020 · 2 comments

Comments

@dodgekaze
Copy link

On the initialisation of the bunqJSClient using NodeJS I receive the following error:

Error: Cannot find module './bunq-js-client-data.json' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at new Store (/root/johnnycash-backend/node_modules/json-store/index.js:6:16) at module.exports (/node_modules/json-store/index.js:35:10) at exports.default (

This is my setup currently. It seems like it thinks the json file in JSONFileStore needs to be a module? I created the file in the directory FYI.

const BunqJSClient = require('@bunq-community/bunq-js-client/dist/BunqJSClient').default

const JSONFileStore = require("@bunq-community/bunq-js-client/dist/Stores/JSONFileStore").default;

const storageInstance = JSONFileStore("./bunq-js-client-data.json");

const bunqJSClient = new BunqJSClient(storageInstance);

bunqJSClient.setKeepAlive(false);
@DerrickAfrifa
Copy link

Did you manage to solve this? I have the same issue.

@slaesh
Copy link

slaesh commented Jul 14, 2021

do it like this instead:

const customStoreFile = `${__dirname}${path.sep}bunq-js-client-data.json`;

// run the file store with a location to store the data
const storageInstance = JSONFileStore(customStoreFile);

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

No branches or pull requests

3 participants