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

html-react-parser with React 19

Open AlessandroGasperini opened this issue 1 year ago • 2 comments

html-react-parser with React 19

I am experiencing an issue with the html-react-parser package when using it with React 19. I’ve encountered compatibility problems which prevent the package from installing.

Version: 5.1.13

React Version: 19.0.0-rc (release candidate version)

Error Details: When attempting to install or use html-react-parser with React 19, npm reports a peer dependency conflict. The specific error message is:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error   react@"^19.0.0-rc-fb9a90fa48-20240614" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"0.14 || 15 || 16 || 17 || 18" from [email protected]
npm error node_modules/html-react-parser
npm error   html-react-parser@"*" from the root project

AlessandroGasperini avatar Aug 27 '24 07:08 AlessandroGasperini

@AlessandroGasperini does this resolve the issue for you? https://github.com/remarkablemark/html-react-parser/issues/1436#issuecomment-2131695591

Relates to https://github.com/remarkablemark/html-react-parser/issues/1455#issuecomment-2291689801

remarkablemark avatar Aug 27 '24 14:08 remarkablemark

@AlessandroGasperini You should wait for the official release of html-react-parser for React 19.

KABILANSRK avatar Aug 27 '24 16:08 KABILANSRK

@AlessandroGasperini Temp solution: you can use this in package.json (make sure to use the react version you use in your project, mine is "19.0.0-rc-66855b96-20241106"):

"overrides": {
    "html-react-parser": {
      "react": "19.0.0-rc-66855b96-20241106"
    }
  },

aabughazaleh avatar Dec 01 '24 09:12 aabughazaleh

Release:

  • https://github.com/remarkablemark/html-react-parser/pull/1628#issuecomment-2521861131

remarkablemark avatar Dec 06 '24 01:12 remarkablemark