oblador / loki

👁 Visual Regression Testing for Storybook
https://loki.js.org/
MIT License
1.79k stars 173 forks source link

Peer dependency warnings with react 18.1 #439

Open Mellbourn opened 1 year ago

Mellbourn commented 1 year ago

We've got Loki basically working with our react-native setup, but we get lots of warnings about overriding peer dependencies, probably because we use react version 18.1.0:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-inspector@5.1.1
npm WARN Found: react@18.1.0
npm WARN node_modules/react
npm WARN   react@"18.1.0" from the root project
npm WARN   143 more (@emotion/core, @emotion/primitives-core, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.4 || ^17.0.0" from react-inspector@5.1.1
npm WARN node_modules/@storybook/addon-actions/node_modules/react-inspector
npm WARN   react-inspector@"^5.1.0" from @storybook/addon-actions@6.5.16
npm WARN   node_modules/@storybook/addon-actions
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^16.8.4 || ^17.0.0" from react-inspector@5.1.1
npm WARN   node_modules/@storybook/addon-actions/node_modules/react-inspector
npm WARN     react-inspector@"^5.1.0" from @storybook/addon-actions@6.5.16
npm WARN     node_modules/@storybook/addon-actions
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @mdx-js/react@1.6.22
npm WARN Found: react@18.1.0
npm WARN node_modules/react
npm WARN   react@"18.1.0" from the root project
npm WARN   143 more (@emotion/core, @emotion/primitives-core, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.13.1 || ^17.0.0" from @mdx-js/react@1.6.22
npm WARN node_modules/@storybook/addon-docs/node_modules/@mdx-js/react
npm WARN   @mdx-js/react@"^1.6.22" from @storybook/addon-docs@6.5.16
npm WARN   node_modules/@storybook/addon-docs
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^16.13.1 || ^17.0.0" from @mdx-js/react@1.6.22
npm WARN   node_modules/@storybook/addon-docs/node_modules/@mdx-js/react
npm WARN     @mdx-js/react@"^1.6.22" from @storybook/addon-docs@6.5.16
npm WARN     node_modules/@storybook/addon-docs
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/router@1.3.4
npm WARN Found: react@18.1.0

We had none of these warnings before importing Loki (version 0.31.0).

We managed to eliminate the warnings with the following overrides. But I'm unsure of how dangerous these are.

  "overrides": {
    "@storybook/react-native": {
      "react": "18.1.0",
      "react-dom": "18.1"
    },
    "@storybook/addon-actions": {
      "react": "18.1.0",
      "react-dom": "18.1"
    },
    "@storybook/addon-docs": {
      "react": "18.1.0",
      "react-dom": "18.1"
    },
    "@storybook/router": {
      "react": "18.1.0",
      "react-dom": "18.1"
    },
    "react-reconciler": {
      "react": "18.1.0",
      "react-dom": "18.1"
    }
  },
tonhao-dev commented 1 year ago
npm WARN ERESOLVE overriding peer dependency
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: loki@0.31.2
npm ERR! Found: @storybook/react@7.0.18
npm ERR! node_modules/@storybook/react
npm ERR!   peerOptional @storybook/react@"^[5](https://github.com/tonhao-dev/citei-frontend/actions/runs/5173161921/jobs/9318171633?pr=7#step:4:6) || ^[6](https://github.com/tonhao-dev/citei-frontend/actions/runs/5173161921/jobs/9318171633?pr=7#step:4:7)" from @loki/integration-react@0.31.2
npm ERR!   node_modules/loki/node_modules/@loki/integration-react
npm ERR!     @loki/integration-react@"^0.31.2" from loki@0.31.2
npm ERR!     node_modules/loki
npm ERR!       dev loki@"^0.31.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @storybook/react@"^5 || ^6" from loki@0.31.2
npm ERR! node_modules/loki
npm ERR!   dev loki@"^0.31.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @storybook/react@6.5.16
npm ERR! node_modules/@storybook/react
npm ERR!   peerOptional @storybook/react@"^5 || ^6" from loki@0.31.2
npm ERR!   node_modules/loki
npm ERR!     dev loki@"^0.31.2" 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! 
npm ERR! See /home/runner/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2023-06-05T04_10_0[8](https://github.com/tonhao-dev/citei-frontend/actions/runs/5173161921/jobs/9318171633?pr=7#step:4:9)_45[9](https://github.com/tonhao-dev/citei-frontend/actions/runs/5173161921/jobs/9318171633?pr=7#step:4:10)Z-debug-0.log
Error: Process completed with exit code 1.

UP

tonhao-dev commented 1 year ago

I solve this using yarn install instead of npm install

anthodb commented 1 year ago

Still an issue..

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @loki/integration-react@0.32.0
npm WARN Found: @storybook/react@7.3.2
npm WARN node_modules/@storybook/react
npm WARN   dev @storybook/react@"7.3.2" from the root project
npm WARN   4 more (@storybook/nextjs, @storybook/preset-react-webpack, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peerOptional @storybook/react@"^5 || ^6" from @loki/integration-react@0.32.0
npm WARN node_modules/@loki/integration-react
npm WARN   @loki/integration-react@"^0.32.0" from loki@0.32.0
npm WARN   node_modules/loki
npm WARN 
npm WARN Conflicting peer dependency: @storybook/react@6.5.16
npm WARN node_modules/@storybook/react
npm WARN   peerOptional @storybook/react@"^5 || ^6" from @loki/integration-react@0.32.0
npm WARN   node_modules/@loki/integration-react
npm WARN     @loki/integration-react@"^0.32.0" from loki@0.32.0
npm WARN     node_modules/loki
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-reconciler@0.26.2
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.2.0" from the root project
npm WARN   212 more (@chakra-ui/accordion, @chakra-ui/alert, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^17.0.2" from react-reconciler@0.26.2
npm WARN node_modules/ink/node_modules/react-reconciler
npm WARN   react-reconciler@"^0.26.2" from ink@3.2.0
npm WARN   node_modules/ink
npm WARN 
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^17.0.2" from react-reconciler@0.26.2
npm WARN   node_modules/ink/node_modules/react-reconciler
npm WARN     react-reconciler@"^0.26.2" from ink@3.2.0
npm WARN     node_modules/ink
Mark-Partola commented 2 weeks ago

Bump. The same issue.