Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for react 17 #84

Open
ptmkenny opened this issue Mar 12, 2021 · 10 comments
Open

Support for react 17 #84

ptmkenny opened this issue Mar 12, 2021 · 10 comments

Comments

@ptmkenny
Copy link

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.

@ashish-choudhary-katapult

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

@durgeshrkumari
Copy link

Can we get this #80 merged?

@enigma1
Copy link

enigma1 commented Oct 9, 2021

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

@remediios
Copy link

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?

@romanown
Copy link

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

@hudakh
Copy link

hudakh commented Jun 24, 2022

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".

@ekeijl
Copy link

ekeijl commented Feb 3, 2023

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.

@romanown
Copy link

romanown commented Feb 6, 2023

thanks. i use webpack 4 and 3.

@Bhoobalan230921
Copy link

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

@mokaty1818795
Copy link

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

Its fails on deployment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants