strophe / strophejs

Strophe.js is an XMPP library for JavaScript
http://strophe.im/strophejs
MIT License
1.46k stars 361 forks source link

Fix use with nodejs #705

Closed mattblickem-evoluno closed 5 months ago

mattblickem-evoluno commented 6 months ago

xmldom does not implement querySelector so in nodejs an uncaught error can be triggered by running non-existant querySelector function

importing strophe.js from node_modules in nodejs by default uses the wrong file (src/index.js). The exports directive in package.json helps nodejs import (or require) the right file: https://nodejs.org/docs/latest-v20.x/api/packages.html#conditional-exports

https://github.com/strophe/strophejs/issues/704

jcbrand commented 5 months ago

Thanks