You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In html-dom-parser/lib/client/utilities.jsvar domhandler = require('domhandler'); acts like import domhandler from 'domhandler';, but it should act like import * as domhandler from 'domhandler';.
I don't have experience with how esm.sh transpiles the code from CJS to ES6, but this was my solution after I manually changed html-dom-parser/lib/client/utilities.js to ES6 and used import * as domhandler from 'domhandler'.
The text was updated successfully, but these errors were encountered:
Failing module
Error message
After
onload
I got this:Additional info
In investigated this issue and the problem seems to be how
require()
vsimport/export
works.In domhandler/lib/esm/index.js we have:
And in html-dom-parser/lib/client/utilities.js we have:
Cause / Solution
In html-dom-parser/lib/client/utilities.js
var domhandler = require('domhandler');
acts likeimport domhandler from 'domhandler';
, but it should act likeimport * as domhandler from 'domhandler';
.I don't have experience with how esm.sh transpiles the code from CJS to ES6, but this was my solution after I manually changed html-dom-parser/lib/client/utilities.js to ES6 and used
import * as domhandler from 'domhandler'
.The text was updated successfully, but these errors were encountered: