Old Import statement of DomUtils
The old import statement of DomUtils in src/index.js breaks the compilation.
export * as DomUtils from "domutils";
Commenting this statement out seems to solve the problem.
Error:
ERROR in ./node_modules/html-to-react/node_modules/htmlparser2/lib/esm/index.js 59:9
Module parse failed: Unexpected token (59:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| return getFeed(parseDOM(feed, options));
| }
> export * as DomUtils from "domutils";
| // Old name for DomHandler
| export { DomHandler as DefaultHandler };
@ ./node_modules/html-to-react/lib/parser.js 2:19-41
@ ./node_modules/html-to-react/index.js
@ ./.storybook/preview.js
Commenting out the export statement in node modules is not a solution but a temporary work-around to get the code running.
I'm getting the same error. Do you have any hints on how to go around this?
Well, not really. I was using the html-to-react library which was using this library as a dependency. I'm using a different library html-react-parser, this does the same thing and works fine.
Also as I mentioned earlier there is a temporary solution to run the code, comment the export statement in node_modules.
Duplicate of https://github.com/fb55/htmlparser2/issues/1237. See https://github.com/fb55/htmlparser2/issues/1237#issuecomment-1182522861 for some suggestions for how to work around this.