Closed cherring07 closed 1 year ago
Same issue here
Hi, I have the same problem. When trying to install the plugin it gives me errors regarding React:
npm ERR! While resolving: backend@0.1.0 npm ERR! Found: react@18.2.0 npm ERR! node_modules/react npm ERR! peer react@"^17.0.0 || ^18.0.0" from @strapi/design-system@1.10.1 npm ERR! node_modules/@strapi/design-system npm ERR! peer @strapi/design-system@"^1.6.0" from strapi-plugin-preview-button@2.0.0 npm ERR! node_modules/strapi-plugin-preview-button npm ERR! strapi-plugin-preview-button@"*" from the root project npm ERR! peer @strapi/design-system@"1.10.1" from @strapi/helper-plugin@4.13.6 npm ERR! node_modules/@strapi/helper-plugin npm ERR! peer @strapi/helper-plugin@"^4.9.0" from strapi-plugin-preview-button@2.0.0 npm ERR! node_modules/strapi-plugin-preview-button npm ERR! strapi-plugin-preview-button@"*" from the root project npm ERR! peer react@"^17.0.0 || ^18.0.0" from @strapi/icons@1.10.1 npm ERR! node_modules/@strapi/icons npm ERR! peer @strapi/icons@"^1.6.0" from strapi-plugin-preview-button@2.0.0 npm ERR! node_modules/strapi-plugin-preview-button npm ERR! strapi-plugin-preview-button@"*" from the root project npm ERR! peer @strapi/icons@"^1.5.0" from @strapi/design-system@1.10.1 npm ERR! node_modules/@strapi/design-system npm ERR! peer @strapi/design-system@"^1.6.0" from strapi-plugin-preview-button@2.0.0 npm ERR! node_modules/strapi-plugin-preview-button npm ERR! strapi-plugin-preview-button@"*" from the root project npm ERR! 1 more (@strapi/helper-plugin) npm ERR! 1 more (@strapi/helper-plugin) npm ERR! 4 more (react-dom, react-router-dom, styled-components, @strapi/helper-plugin) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^17.0.2" from strapi-plugin-preview-button@2.0.0 npm ERR! node_modules/strapi-plugin-preview-button npm ERR! strapi-plugin-preview-button@"*" from the root project
Does anybody know how I can fix it?
Hi @mattmilburn, are you planning on merging one of the open PRs updating the peer dependency? If not, is there a workaround? We would like to use your preview buttons in a current project.
Hi @cherring07 @LucasLavallee @joserangel25 @heichel, this should be fixed in the latest release v2.1.0. For the record, I was never able to reproduce this but it doesn't hurt to add the support, which was inevitable anyway.
If you continue to have issues, please post about it here and include as much of your package.json
as possible and maybe screenshots/errors if you have them.
Base install of...
Running...
npm i strapi-plugin-preview-button@latest
Then...
I think bumping the React version should solve the error, but not sure if there are any side effects,