p0o / steem-bot

Easy automation on top of Steem blockchain
MIT License
53 stars 40 forks source link

TypeError: Cannot read property 'catch' of undefined. #10

Closed antoncoding closed 6 years ago

antoncoding commented 6 years ago

When I tried to run your script errorHandling.js I ran into this error:

TypeError: Cannot read property 'catch' of undefined
    at Object.<anonymous> (C:\steemUpvoteBot\upvote-bot\errorhandle.js:30:12)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

It seems like the catch() in the last line is not working properly, while the one after responder.comment() is working just fine.

p0o commented 6 years ago

I can't replicate this issue. Please make sure your package is updated to the latest version. In order to do that make sure the version for steem-bot in your package.json is 0.8.0 and do this in terminal:

rm -rf node_modules
npm i
antoncoding commented 6 years ago

Yes I did check that in package.json, my steem-bot version is 0.8.0 but after I changed the import line to

const SteemBot = require('steem-bot').default

and command

node errorHandling.js

the error occured.

p0o commented 6 years ago

My apologies I forgot to update the dist files. Please get the latest package @0.8.1 and the problem should be solved.

antoncoding commented 6 years ago

@p0o Thanks a lot!