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

Support for react 17

Open ptmkenny opened this issue 3 years ago • 10 comments

I just updated to react 17, which gave me this message:

npm WARN [email protected] requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0-0 but none is installed. You must install peer dependencies yourself.

It'd be great if this could be updated to say it supports React 17. Since there are no feature changes in React 17, it can basically be used as is.

ptmkenny avatar Mar 12 '21 18:03 ptmkenny

npm install react-html-parser --legacy-peer-deps - its work

Can we get this https://github.com/peternewnham/react-html-parser/pull/80 merged?

durgeshrkumari avatar Aug 26 '21 19:08 durgeshrkumari

@durgeshrkumari I left a comment in the merge request about the htmlparser2 dep. Without changing it, I was getting runtime errors in my tests.

enigma1 avatar Oct 09 '21 13:10 enigma1

On React v17, tried with and without "npm install react-html-parser --legacy-peer-deps" and still getting errors as: "Compiled with problems: ERROR in ./node_modules/react-html-parser/node_modules/htmlparser2/lib/WritableStream.js 9:13-37 Module not found: Error: Can't resolve 'buffer' in ..." Any help?

remediios avatar Jan 20 '22 23:01 remediios

i found fork https://github.com/hedgedoc/html-to-react can it help?

romanown avatar May 29 '22 19:05 romanown

I'm using react 18.2 and have a similar issue.

warning " > [email protected]" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0-0".

hudakh avatar Jun 24 '22 07:06 hudakh

On React v17, tried with and without "npm install react-html-parser --legacy-peer-deps" and still getting errors as: "Compiled with problems: ERROR in ./node_modules/react-html-parser/node_modules/htmlparser2/lib/WritableStream.js 9:13-37 Module not found: Error: Can't resolve 'buffer' in ..." Any help?

react-html-parser uses an old version of the htmlparser2 package (3.9.2), which uses NodeJS APIs such as Buffer (example).

Since Webpack v5, these NodeJS APIs are no longer included by default, you probably need to install node-polyfill-webpack-plugin and add it to the plugins section of your Webpack configuration.

ekeijl avatar Feb 03 '23 13:02 ekeijl

thanks. i use webpack 4 and 3.

romanown avatar Feb 06 '23 23:02 romanown

Yes i'm also facing the same problem , i use for react 17 version this react 17 version support for react-html-parser 3.0.9

Bhoobalan230921 avatar Mar 02 '23 07:03 Bhoobalan230921

npm install react-html-parser --legacy-peer-deps - its work

Its fails on deployment

mokaty1818795 avatar Mar 08 '23 13:03 mokaty1818795