Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not run under node v12 #127

Closed
gloomytrousers opened this issue Oct 13, 2019 · 13 comments
Closed

Does not run under node v12 #127

gloomytrousers opened this issue Oct 13, 2019 · 13 comments

Comments

@gloomytrousers
Copy link

Attempting to run hubot with xmpp connector under node v12, I get:

[Sun Oct 13 2019 12:29:05 GMT-0100 (Greenwich Mean Time)] ERROR TypeError: crypto.createCredentials is not a function
  at connect (/opt/hubot/node_modules/tls-connect/starttls.js:231:51)
  at Connection.setSecure (/opt/hubot/node_modules/node-xmpp-core/lib/Connection.js:320:19)
  at Connection.onStanza (/opt/hubot/node_modules/node-xmpp-core/lib/Connection.js:367:10)
  at StreamParser.<anonymous> (/opt/hubot/node_modules/node-xmpp-core/lib/Connection.js:226:10)
  at StreamParser.emit (events.js:210:5)
  at SaxLtx.<anonymous> (/opt/hubot/node_modules/node-xmpp-core/lib/StreamParser.js:58:14)
  at SaxLtx.emit (events.js:210:5)
  at SaxLtx._handleTagOpening (/opt/hubot/node_modules/ltx/lib/parsers/ltx.js:37:14)
  at SaxLtx.write (/opt/hubot/node_modules/ltx/lib/parsers/ltx.js:159:18)
  at StreamParser.write (/opt/hubot/node_modules/node-xmpp-core/lib/StreamParser.js:123:17)
  at Connection.onData (/opt/hubot/node_modules/node-xmpp-core/lib/Connection.js:305:17)
  at Socket.emit (events.js:215:7)
  at addChunk (_stream_readable.js:308:12)
  at readableAddChunk (_stream_readable.js:289:11)
  at Socket.Readable.push (_stream_readable.js:223:10)
  at TCP.onStreamRead (internal/stream_base_commons.js:182:23)

It's OK under node v10, although I get these warnings, the first of which gives the obvious reason and the fix, and the second of which should also be addressed:

(node:10) [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
(node:10) [DEP0107] DeprecationWarning: tls.convertNPNProtocols() is deprecated.
@markstory
Copy link
Contributor

Any chance you would want to make a pull request for this? I no longer run a hubot on xmpp so this project is mostly in maintenance mode.

@gloomytrousers
Copy link
Author

I've done some digging. The dependency chain to the offending package is hubot-xmpp@0.2.6 -> node-xmpp-client@3.0.0 -> node-xmpp-core@4.2.0-> tls-connect@0.2.2

The change in tls-connect is trivial, but isn't the way to go here.

https://www.npmjs.com/package/node-xmpp-client (currently at v3.2.0, 3 years old) says:

this package is deprecated please use https://www.npmjs.com/package/@xmpp/client

and https://www.npmjs.com/package/node-xmpp-core (currently v5.0.9, also 3 years old) says:

this package is deprecated please use https://github.com/xmppjs/xmpp.js

(https://www.npmjs.com/package/@xmpp/client code is https://github.com/xmppjs/xmpp.js)

So I think hubot-xmpp needs updating to use this. This isn't really my area of expertise; it appears it might be relatively straightforward for someone suitably skilled but isn't something I can commit to right now.

@sonnyp
Copy link
Member

sonnyp commented Nov 23, 2019

Author of xmpp.js here (and latest maintainer of node-xmpp).

node-xmpp is not maintained anymore
I'd like to make a xmpp.js adapter for hubot.

Normally I would send a PR here but since it is in maintanance mode it doesn't make sense.

@markstory would you be willing to transfer the hubot-xmpp npm name?

@markstory
Copy link
Contributor

Sure. I would be happy to transfer this repository as well if you're interested.

@sonnyp
Copy link
Member

sonnyp commented Nov 24, 2019

that'd be great to keep the history

Can you transfer to https://github.com/xmppjs ?

@markstory
Copy link
Contributor

@sonnyp Sure. I've added you as a collaborator on this project but I don't think that will let you do the transfer. If I could be temporarily added to the xmppjs organization I could transfer the repository.

@sonnyp
Copy link
Member

sonnyp commented Nov 26, 2019

@markstory done

@markstory
Copy link
Contributor

@sonnyp Thanks, I'll need 'create repository' privilege in order to do the transfer.

@sonnyp
Copy link
Member

sonnyp commented Nov 29, 2019

@markstory granted, sorry for the delay

@markstory
Copy link
Contributor

@sonnyp Moved now. What username should I add to the npm package?

@sonnyp
Copy link
Member

sonnyp commented Nov 29, 2019

Thanks, sonny please

@sonnyp
Copy link
Member

sonnyp commented Nov 30, 2019

@gloomytrousers could you try hubot-xmpp 0.3.0 ?

https://github.com/xmppjs/hubot-xmpp/releases/tag/v0.3.0

It still uses node-xmpp for now but the last version which should fix your issue.

@gloomytrousers
Copy link
Author

Seems to be running perfectly, thanks @sonnyp !

gregkare added a commit to 67P/hal8000 that referenced this issue Apr 1, 2021
It fixes an issue that prevented it from running under Node 12:
xmppjs/hubot-xmpp#127

Co-authored-by: Garret Alfert <alfert@wevelop.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants