d4rkr00t / prosemirror-dev-tools

Developer Tools for ProseMirror
317 stars 37 forks source link

Issue with React 17 peer dependency #109

Closed louisstow closed 1 year ago

louisstow commented 3 years ago
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   peer react@">=16.8.0" from prosemirror-dev-tools@3.0.2
npm ERR!   node_modules/prosemirror-dev-tools
npm ERR!     dev prosemirror-dev-tools@"*" from the root project
npm ERR!   peer react@"17.0.2" from react-dom@17.0.2
npm ERR!   node_modules/react-dom
npm ERR!     peer react-dom@">=16.8.0" from prosemirror-dev-tools@3.0.2
npm ERR!     node_modules/prosemirror-dev-tools
npm ERR!       dev prosemirror-dev-tools@"*" from the root project
npm ERR!   3 more (@emotion/core, @emotion/styled, react-dock)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.0.0 || ^16.0.0" from react-json-tree@0.11.2
npm ERR! node_modules/prosemirror-dev-tools/node_modules/react-json-tree
npm ERR!   react-json-tree@"^0.11.2" from prosemirror-dev-tools@3.0.2
npm ERR!   node_modules/prosemirror-dev-tools
npm ERR!     dev prosemirror-dev-tools@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
Javarome commented 3 years ago

Are those dev tools React-dependent? That would be too bad as Prosemirror is not. Indeed, after installing those dev tools 3.0.2 i get a dependency error (I use vanilla JS without React):

Module not found: Error: Can't resolve 'react' in '/myproject/node_modules/unstated/lib'
 @ ./node_modules/prosemirror-dev-tools/dist/esm/index.js 3:0-36 26:52-60

Looking at the mentioned line, it says:

import { Provider } from "unstated";
louisstow commented 3 years ago

@Javarome see if this PR fixes it for you: https://github.com/d4rkr00t/prosemirror-dev-tools/pull/110

romanKrds commented 3 years ago

@louisstow Thank you for the #110, It worked for me. Can we hope that it will be merged in the near future?

kachkaev commented 2 years ago

React 17 has been listed as peer dependency in https://github.com/d4rkr00t/prosemirror-dev-tools/commit/adcf9688dc5f64afcd52e8f2c29b20a67ac06bd8. I guess that #110 is no longer needed.

danielknaust commented 2 years ago

@louisstow It seems this is still an issue as react-json-tree is added as a dependency, which explicitly lists React 15-16 as a peer dependency.