Skip to content

ESM import regression: HTMLHint named export no longer available in htmlhint@1.8.1 #1800

@sangafabrice

Description

@sangafabrice

Describe the bug

Since upgrading to htmlhint@1.8.1, importing HTMLHint as a named export in an ESM context throws an error indicating that the module does not provide the HTMLHint export.

In previous versions, the following ESM import worked:

import { HTMLHint } from "htmlhint";

With 1.8.1, Node.js reports that htmlhint is a CommonJS module and that the named export cannot be resolved.

To Reproduce

Environment:

  • Node.js: v24.13.0
  • OS: Windows (reproducible in other environments as well)
  • Module system: ESM

Steps:

npm install --save-exact htmlhint@1.8.1
node --eval 'import { HTMLHint } from "htmlhint";'

Result:

SyntaxError: Named export 'HTMLHint' not found. The requested module 'htmlhint' is a CommonJS module...

Node suggests using:

import pkg from "htmlhint";
const { HTMLHint } = pkg;

Expected behavior

The following command should execute without error:

node --eval 'import { HTMLHint } from "htmlhint";'

—or the documentation / changelog should explicitly mention that named ESM imports are no longer supported if this is an intentional breaking change.

Pinned by coliff

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions