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

Getting an error saying f is not a constructor

Open PenghaiZhang opened this issue 7 months ago • 11 comments

Expected Behavior

We have recently upgraded our build tool Parcel to v2.13.3, and since then we started having an error about f is not a constructor.

Image

This is how we use the parser:

  1. Import the parser through import HTMLReactParser from "html-react-parser";
  2. Pass a string to the parser

Image

It's expected no errors should occur.

We are using 3.0.16, but the error still occurs after we upgrade to 5.2.2. However, the error message is a bit more readable after the upgrade - Text is not a constructor.

Actual Behavior

Getting the error as described above.

Steps to Reproduce

Not sure if the issue is related to Parcel 2.13.x, but this is the only thing we did to trigger the issue.

Environment

  • Version: both 3.0.16 and 5.2.2
  • Platform:
  • Browser: Chrome 131.0.6778.204
  • OS: Ubuntu 22

PenghaiZhang avatar Mar 12 '25 04:03 PenghaiZhang