Skip to content

Bug: entities_1.default is undefined in v8.0.0 (Node.js 26) #308

Description

@sergiolindau

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions