Skip to content

「ESM build」Broken relative import in /esm/client/html-to-dom.mjs under strict ESM resolvers (CodeSandbox / Webpack5 experiments) #1222

@Div627

Description

@Div627

Expected Behavior

html-react-parser should work correctly in CodeSandbox (Vite/ESM-based environment).

Actual Behavior

When using html-react-parser in CodeSandbox, the console throws a module resolution error:
Could not find module in path: 'html-dom-parser/lib/client/html-to-dom.js'
relative to '/node_modules/html-dom-parser/esm/client/html-to-dom.mjs'

Steps to Reproduce

Use html-react-parser in CodeSandbox.

Reproducible Demo

https://codesandbox.io/p/sandbox/old-glade-v6jvnl

Environment

  • Version: "html-react-parser": "^5.2.6",
  • Platform:
  • Browser:
  • OS:

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions