-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use with NodeJS #704
Comments
@jcbrand cheers for merge! is an npm release on the horizon? |
+1 to a patch release here; I seem to have the same issue, where I'm writing ES modules and node complains that strophe.js 2.0.0 is a CommonJS module when I |
I've just made a release. Thanks for your patience. |
Unfortunately I found a bug in the package.json. Could you please check whether the 3.0.0 release works for you, and whether this followup commit breaks anything? Thanks 🙏 |
Hello @jcbrand! The v3.0.0 release works fine with NodeJS, however the followup commit is breaking it again. To make it behave properly I changed the
The idea comes from https://webpack.js.org/guides/package-exports/#providing-commonjs-and-esm-version-stateless. |
Hi @thibautsabot, can you please make a pull request with your change? Thanks 🙏 |
Sure! #712 |
Cannot import strophe.js using NodeJS
See
https://github.com/mattblickem-evoluno/replicate-strophejs-nodejs-import/blob/main/strophe.js
If we apply the following to
strophe.js/package.json
:Then the import works, but another issue hits:
querySelector
is not a function because it is not implemented by the XML parsing library.This can be fixed by doing
node.tagName === 'parsererror'
instead.Replication
See https://github.com/mattblickem-evoluno/replicate-strophejs-nodejs-import
PR
I am happy to provide a PR to fix
The text was updated successfully, but these errors were encountered: