Closed heypiotr closed 2 years ago
Thanks for your submission!
Unfortunately, ESM has caused a lot of confusion and issues for many of us. One of the primary reasons behind this is the fundamentally different way that ESM handles import / export.
The pattern we've followed to enable ESM is a standard technique, as described here: https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1
Please see this comment in a similar PR for more detail on why the syntax we've used is correct:
The thread may also help in getting it working for you. Best of luck!
Oh, interesting! Thanks for sharing ❤️
esm/index.js
currently does:This is importing the default export from
../dist/index.js
AKAsrc/index.ts
, which is theparse
function:... which means when
esm/index.js
later tries to do this:...
nhp
is actually theparse
function, which meansnhp.CommentNode
is undefined.