Closed sastan closed 3 years ago
What's the reason for trying to use named imports from a UMD bundle? UMD does not support named imports, so importing the module will only return its exports as a default export.
You are right. The culprit seems to be this line from node-html-parser
: import { decode } from 'he';
(https://github.com/taoqf/node-html-parser/blob/master/src/nodes/html.ts#L1)
I'll open an issue there.
Thank you for your time.
All good! FWIW I am currently exploring what it would take to have WMR "patch" the named import issue, the blocker is generally production output. It's the reason some usage of react-is
fails in WMR too, so if there ends up being a way to fix it without hurting performance in cases where's the behavior is unused, it's something I'd like to land.
In twind we are using node-html-parser which uses he (A robust HTML entities encoder/decoder with full Unicode support.).
It seems as wmr does not detect the exports from
he
and fails with the following error:he
uses the UMD format. Below is the relevant code from the entry js ofhe
:As a current workaround we bundle all dependencies in the module that is used by wmr.