Bug: entities_1.default is undefined in v8.0.0 (Node.js 26)
Description
After upgrading from node-html-parser@7.1.0 to node-html-parser@8.0.0, my build process fails at runtime when accessing element attributes.
The error occurs inside the published package code:
node_modules/node-html-parser/dist/nodes/html.js:17
return entities_1.default.decodeHTML(val);
TypeError: Cannot read properties of undefined (reading 'decodeHTML')
Environment
- node-html-parser: 8.0.0
- Node.js: 26.3.0
- OS: Windows 10
Stack Trace
node_modules\node-html-parser\dist\nodes\html.js:17
return entities_1.default.decodeHTML(val);
^
TypeError: Cannot read properties of undefined (reading 'decodeHTML')
at decode (...\node-html-parser\dist\nodes\html.js:17:31)
at get attributes (...\node-html-parser\dist\nodes\html.js:599:30)
...
Installed Dependencies
node-html-parser@8.0.0
└── entities@8.0.0
Relevant Compiled Code
The published CommonJS bundle contains:
const entities_1 = __importDefault(require("entities"));
function decode(val) {
return entities_1.default.decodeHTML(val);
}
However, at runtime entities_1.default is undefined, causing the package to crash when decoding attributes.
Expected Behavior
HTML should be parsed normally, as in v7.1.0.
Actual Behavior
Accessing attributes triggers:
TypeError: Cannot read properties of undefined (reading 'decodeHTML')
Notes
This looks like a CommonJS/ESM interop issue involving the entities package.
Version 7.1.0 works correctly in the same project and environment, while 8.0.0 fails immediately.
Bug:
entities_1.defaultis undefined in v8.0.0 (Node.js 26)Description
After upgrading from
node-html-parser@7.1.0tonode-html-parser@8.0.0, my build process fails at runtime when accessing element attributes.The error occurs inside the published package code:
Environment
Stack Trace
Installed Dependencies
Relevant Compiled Code
The published CommonJS bundle contains:
However, at runtime
entities_1.defaultisundefined, causing the package to crash when decoding attributes.Expected Behavior
HTML should be parsed normally, as in v7.1.0.
Actual Behavior
Accessing attributes triggers:
Notes
This looks like a CommonJS/ESM interop issue involving the
entitiespackage.Version 7.1.0 works correctly in the same project and environment, while 8.0.0 fails immediately.