superfeedr / superfeedr-node

A library to interract with Superfeedr's XMPP API in any node application
http://superfeedr.com/documentation#xmpp_pubsub
31 stars 17 forks source link

xmpp.Iq is not a constructor #26

Open ghost opened 7 years ago

ghost commented 7 years ago

I get the error "TypeError: xmpp.Iq is not a constructor" when using the subscribe function

The error occurs on line 190 within superfeedr.js: var subscribeStanza = new xmpp.Iq({to: SUPERFEEDR_ENDPOINT, id:id, type:'set', from: this.client.jid})

var subscribeStanza = new xmpp.Iq({to: SUPERFEEDR_ENDPOINT, id:id, type:'set',
 from: this.client.jid})
                        ^

TypeError: xmpp.Iq is not a constructor
    at Superfeedr.subscribe (C:\Users\pierr\Documents\Programing\Node\rss-feed-r
eader\node_modules\superfeedr\lib\superfeedr.js:190:25)
    at Superfeedr.<anonymous> (C:\Users\pierr\Documents\Programing\Node\rss-feed
-reader\index.js:6:10)
    at emitNone (events.js:86:13)
    at Superfeedr.emit (events.js:185:7)
    at Client.<anonymous> (C:\Users\pierr\Documents\Programing\Node\rss-feed-rea
der\node_modules\superfeedr\lib\superfeedr.js:19:10)
    at emitOne (events.js:96:13)
    at Client.emit (events.js:188:7)
    at Client.useFeatures (C:\Users\pierr\Documents\Programing\Node\rss-feed-rea
der\node_modules\node-xmpp-client\lib\Client.js:365:10)
    at Client._handleSessionState (C:\Users\pierr\Documents\Programing\Node\rss-
feed-reader\node_modules\node-xmpp-client\lib\Client.js:261:10)
    at Client._handleStanza (C:\Users\pierr\Documents\Programing\Node\rss-feed-r
eader\node_modules\node-xmpp-client\lib\Client.js:242:14)
marcusdomingo commented 7 years ago

bump

jonbaer commented 6 years ago

+1

lumberbeard commented 6 years ago

I fixed this on my side. If you debug and look at the valid functions for new xmpp.Iq you'll see it's now IQ rather than Iq. Modifying this fixed the code.

-Brian

jbbae commented 6 years ago

+1