htmlparser2
htmlparser2 copied to clipboard
Does not work in a ESM project
When trying to run a service with the following TSConfig:
"module": "ESNext",
"moduleResolution": "node",
an error is thrown:
import { Parser as T } from "../../../../node_modules/htmlparser2/lib/esm/Parser.js";
^^^^^^
SyntaxError: Named export 'Parser' not found. The requested module '../../../../node_modules/htmlparser2/lib/esm/Parser.js' is a CommonJS module, which may not support all module.exports as named exports.
Might be related to https://github.com/fb55/htmlparser2/issues/1782