Skip to content

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

@wojtekmaj

Description

@wojtekmaj

Expected Behavior

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

Actual Behavior

html-react-parser is not resolved correctly:

https://arethetypeswrong.github.io/?p=html-react-parser%405.1.2

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

image

Steps to Reproduce

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

import parse from 'html-react-parser';

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

Reproducible Demo

Environment

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

Keywords

Relates to remarkablemark/html-dom-parser#669

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions