Steemconnect (v3) Bugfix

in utopian-io •  2 months ago  (edited)

Pull request:

I was working on a node.js backend when I ran into the following issue with the comment and vote function of Steemconnect:

window is not defined                                                                                                                                          21:37:25

  at hasChromeExtension (node_modules/steemconnect/lib/index.js:43:3)
  at useSteemKeychain (node_modules/steemconnect/lib/index.js:49:11)
  at (node_modules/steemconnect/lib/index.js:201:11)
  at (api/index.js:104:34)
  at node_modules/steemconnect/lib/index.js:179:16
  at process._tickCallback (internal/process/next_tick.js:68:7)

I thought window && ... should be fine but apparently it was not. This lead me to the solution:

So now Steemconnect (3.0.1) works with Node.js as intended: SteemConnect.js was designed to work both in the browser and in Node.js.

Thank you @fabien for taking action so quickly and releasing a new version. I can continue with my project now, which will be announced soon. :)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for your contribution. I think it is better to use "!==" instead of "!=" as a good coding style.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.

Need help? Chat with us on Discord.


I think it is better to use "!==" instead of "!=" as a good coding style.

I absolutely agree. Thanks! I'm working with Go these days at work. Maybe that's why I forgot. :D

Thank you for your review, @justyy! Keep up the good work!

Hi @mkt!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @mkt!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support!
Simply set as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord

Vote for Utopian Witness!