html-dom-parser icon indicating copy to clipboard operation
html-dom-parser copied to clipboard

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

Open Div627 opened this issue 4 months ago • 0 comments

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:

Div627 avatar Oct 13 '25 07:10 Div627