xmppjs / xmpp.js

XMPP for JavaScript
ISC License
2.18k stars 371 forks source link

XML must be a child, i dont understand #921

Closed Zedonboy closed 2 years ago

Zedonboy commented 2 years ago

⚠ If you need help with XMPP itself, please visit https://xmpp.org/community/ instead.

Describe the bug I used the parser to type raw iq stanzas but I get XML error must be a child, like the examples

`const iqStanza = parse(`
    <iq id="MTgwNTgxNGUtMDc1OC00ODlmLWIyMTMtMmRjMzM0Y2U3Y2E2M2E1NzIxOGFmNzVhYTExY2Y5NzM0MTdlYzkwYjY2ZjhhYTc5YzE0YmExN2Y5NDY5NjVhZTJmZDIyMGEzZjUyNw==" type="get">
        <ping xmlns="urn:xmpp:ping"></ping>
    </iq>`

Logs

XMLError: 
     must be a child.
    at Parser.onText (/home/declan/DEV/Apps/BaatChat/baatChatClient/node_modules/@xmpp/xml/lib/Parser.js:63:26)

Environment Linux. I need help

Zedonboy commented 2 years ago

Solved mine const message = "<stanza here/>" const iqstanza = parse(message)