swissmanu / harmonyhubjs-client

A Node.JS library which allows you to interact with your Logitech Harmony Hub.
https://github.com/swissmanu/harmonyhubjs-client
MIT License
155 stars 42 forks source link

Latest node-xmpp-client (v1.0.0) throws an error #12

Closed sushilks closed 8 years ago

sushilks commented 9 years ago

When using with another project https://github.com/sushilks/harmonyHubCLI One of the users reported the following errors with the latest packages.

/home/pi/harmonyHubCLI/node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/lib/login/hub.js:63
if(response.identity && response.identity !== undefined) {
^
TypeError: Cannot read property 'identity' of undefined
at Client. (/home/pi/harmonyHubCLI/node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/lib/login/hub.js:63:15)
at Client.emit (events.js:107:17)
at Client.onStanza (/home/pi/harmonyHubCLI/node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/index.js:224:14)
at Connection.emit (events.js:107:17)
at Connection.onStanza (/home/pi/harmonyHubCLI/node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/node_modules/node-xmpp-core/lib/Connection.js:370:14)
at StreamParser. (/home/pi/harmonyHubCLI/node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/node_modules/node-xmpp-core/lib/Connection.js:226:14)
at StreamParser.emit (events.js:107:17)
at SaxLtx. (/home/pi/harmonyHubCLI/node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/node_modules/node-xmpp-core/lib/StreamParser.js:59:22)
at SaxLtx.emit (events.js:107:17)
at SaxLtx._handleTagOpening (/home/pi/harmonyHubCLI/node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/node_modules/node-xmpp-client/node_modules/node-xmpp-core/node_modules/ltx/lib/parsers/ltx.js:30:18)

As a temporary fix, downgrading the version works, but this needs to be resolved in a better way.

sed -i.bak 's/"node-xmpp-client".*/"node-xmpp-client":"1.0.0-alpha23",/' node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/package.json pushd node_modules/harmony-hub-util/node_modules/harmonyhubjs-client/ npm install popd

sushilks commented 9 years ago

Looks like it's the same issue as https://github.com/swissmanu/harmonyhubjs-client/issues/11

swissmanu commented 9 years ago

please have a look at #10. the problem is, most probably, related with the XMPP stanza parser deep below.

however, i'll have a look into possible changes from node-xmpp-client which result in incompatibilities.

sushilks commented 9 years ago

Thanks, yes it's the same. No rush on my side, I revert back to old version.

swissmanu commented 8 years ago

Version 1.1.8 should fix the mess with node-xmpp-* and ltx.

Please make sure you are using the latest version of npm (npm install npm -g) and try to install the newest version 1.1.8 of harmonyhubjs-client (release notes here: https://github.com/swissmanu/harmonyhubjs-client/releases/tag/v1.1.8)