htmlparser2 icon indicating copy to clipboard operation
htmlparser2 copied to clipboard

Does not work in a ESM project

Open kibertoad opened this issue 1 year ago • 1 comments

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.

kibertoad avatar Oct 09 '24 10:10 kibertoad

Might be related to https://github.com/fb55/htmlparser2/issues/1782

kibertoad avatar Oct 24 '24 11:10 kibertoad