How to correctly import Strophe.js Plugins in node.js?

176 views
Skip to first unread message

Raphy

unread,
Jun 11, 2021, 4:46:40 PM6/11/21
to Strophe

Hi!

I'm able to make Strophe.js connect to XMPP server :

import { Strophe } from '../../../lib/strophejs/strophe.common.js';
let [conn, setConn] = React.useState(new Strophe.Connection("");
conn.connect("","");

in /var/log/prosody : 

Jun 11 11:32:48 mod_bosh    info    New BOSH session, assigned it sid 'fcda78ab-df5c-4bf4-a7ef-66fa4448f49d'

But I do not know how to import Strophe.js Plugins:

I installed with "yarn add install strophejs-plugin-disco":
and the imported:
import 'strophejs-plugin-disco';

But with:
conn.connect("");

I get: Cannot read property 'info' of undefined

How to correctly import Strophe.js Plugins in node.js?

node: v14.17.0
OS: Ubuntu 20.04
Reply all
Reply to author
Forward
0 new messages