Ekliptor / WolfBot

Crypto currency trading bot written in TypeScript for NodeJS
https://wolfbot.org
GNU Affero General Public License v3.0
710 stars 215 forks source link

"testData.forEach is not a function" #5

Closed tiengtinh closed 6 years ago

tiengtinh commented 6 years ago

Hi,

I got this error while trying to run the bot

2018-07-31 11:44:07 - info: Initializing database: Creating collections on first start
2018-07-31 11:44:08 - warn: Uncaught Exception
2018-07-31 11:44:08 - warn:  {"message":"testData.forEach is not a function","stack":"TypeError: testData.forEach is not a function\n    at utils.test.readData (/home/tinh/workspace/projects/blockchain/WolfBot/node_modules/@ekliptor/bit-models/models/serverConfig.ts:395:26)\n    at ReadFileContext.fs.readFile [as callback] (/home/tinh/workspace/projects/blockchain/WolfBot/node_modules/@ekliptor/apputils/test.ts:6:20)\n    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:437:13)"}
2018-07-31 11:44:08 - warn: TypeError: testData.forEach is not a function
    at utils.test.readData (/home/tinh/workspace/projects/blockchain/WolfBot/node_modules/@ekliptor/bit-models/models/serverConfig.ts:395:26)
    at ReadFileContext.fs.readFile [as callback] (/home/tinh/workspace/projects/blockchain/WolfBot/node_modules/@ekliptor/apputils/test.ts:6:20)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:437:13)

It seems this file https://github.com/Ekliptor/bit-models/blob/master/models/serverConfig.ts#L392 expect the file serverConfig.json which I can't find anywhere

Ekliptor commented 6 years ago

That is an error from my database module package: https://github.com/Ekliptor/bit-models Although I can not reproduce it. Do you have the folder models/data/test? in bit-models? Luckily this data is not really needed. So I just uploaded a new version with a fix for this. Please ensure you have bit-models version 1.0.35 and install the bot again with an empty database.

Update: That file really wasn't part of the NPM version of the module. As you already said you can't find it;) Luckily not needed, so updating will fix it.