Skip to content
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

lib/client/html-to-dom.mjs is not a valid ECMAScript Module #334

Closed
gregatgoogle opened this issue Aug 19, 2022 · 4 comments · Fixed by #335 or #336
Closed

lib/client/html-to-dom.mjs is not a valid ECMAScript Module #334

gregatgoogle opened this issue Aug 19, 2022 · 4 comments · Fixed by #335 or #336
Assignees
Labels

Comments

@gregatgoogle
Copy link

0c4c2b6 has added https://github.com/remarkablemark/html-dom-parser/blob/master/lib/client/html-to-dom.mjs with

module.exports = HTMLDOMParser;
module.exports.default = HTMLDOMParser;

which are not valid ECMAScript exports statements (valid syntax). export and export default are, like in index.mjs.

The end result is this is that my project crashes on browser with ReferenceError: module is not defined.

Could you either revert that change or make it ECMAScript compliant?

@remarkablemark
Copy link
Owner

Would you be open to making a PR? The fix would be the following, right?

export default HTMLDOMParser;

@gregatgoogle
Copy link
Author

I can but I would need to ask my employer for permission to contribute to your code, which could take days (or weeks?). If you are willing to wait, I can do it.

@remarkablemark
Copy link
Owner

Ok no problem, I can take it

@remarkablemark
Copy link
Owner

Release #336 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants