Skip to content

Resolution error when using TypeScript with moduleResolution set to node16 or nodenext #669

@wojtekmaj

Description

@wojtekmaj

Expected Behavior

html-dom-parser to resolve correctly when using TypeScript with moduleResolution set to node16 or nodenext (effectively: in pure ESM environment).

Actual Behavior

html-dom-parser is not resolved correctly:

https://arethetypeswrong.github.io/?p=html-dom-parser%405.0.7

This also causes the types to be non-functional in VSCode.

Steps to Reproduce

Create a project using TypeScript with moduleResolution set to node16 or nodenext.
Create a file with the following content:

import htmlToDOM from 'html-dom-parser';

you'll already see, when you hover over htmlToDOM bit, that types are not loaded correctly.

Reproducible Demo

Environment

  • Version: 5.1.2
  • Platform: Node.js
  • Browser: not applicable
  • OS: macOS Sonoma 14.2.1

Keywords

Relates to remarkablemark/html-react-parser#1305

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions