We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
domhandler has supported ESM since v5 fb55/domhandler@5582477
domhandler
But html-dom-parser still imports commonjs format of domhandler with the latest version(v5.0.3) https://github.com/remarkablemark/html-dom-parser/blob/master/package.json#L45.
html-dom-parser
That will cause some TypeErrors when you try to build a package with html-dom-parser to ESM, as domhandler import as esm, the uses like require('domhandler').Text get undefined: https://github.com/remarkablemark/html-dom-parser/blob/master/lib/client/utilities.js#L9
require('domhandler').Text
So i think html-dom-parser should support ESM build
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue @AlbertAZ1992! Would you be interested in opening a PR?
Sorry, something went wrong.
Yes. But since we cannot use ESM in CommonJS, i think that rewrite the lib/client with ESM and build to CommonJS is the only way.
lib/client
Can't we follow the same approach as html-react-parser? Only a single index.mjs was created and the require in the other files were untouched
index.mjs
require
Successfully merging a pull request may close this issue.
domhandler
has supported ESM since v5 fb55/domhandler@5582477But
html-dom-parser
still imports commonjs format ofdomhandler
with the latest version(v5.0.3) https://github.com/remarkablemark/html-dom-parser/blob/master/package.json#L45.That will cause some TypeErrors when you try to build a package with
html-dom-parser
to ESM, asdomhandler
import as esm, the uses likerequire('domhandler').Text
get undefined: https://github.com/remarkablemark/html-dom-parser/blob/master/lib/client/utilities.js#L9So i think
html-dom-parser
should support ESM buildThe text was updated successfully, but these errors were encountered: