loki icon indicating copy to clipboard operation
loki copied to clipboard

Peer dependency warnings with react 18.1

Open Mellbourn opened this issue 2 years ago • 3 comments

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: [email protected]
npm WARN Found: [email protected]
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 [email protected]
npm WARN node_modules/@storybook/addon-actions/node_modules/react-inspector
npm WARN   react-inspector@"^5.1.0" from @storybook/[email protected]
npm WARN   node_modules/@storybook/addon-actions
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"^16.8.4 || ^17.0.0" from [email protected]
npm WARN   node_modules/@storybook/addon-actions/node_modules/react-inspector
npm WARN     react-inspector@"^5.1.0" from @storybook/[email protected]
npm WARN     node_modules/@storybook/addon-actions
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @mdx-js/[email protected]
npm WARN Found: [email protected]
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/[email protected]
npm WARN node_modules/@storybook/addon-docs/node_modules/@mdx-js/react
npm WARN   @mdx-js/react@"^1.6.22" from @storybook/[email protected]
npm WARN   node_modules/@storybook/addon-docs
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"^16.13.1 || ^17.0.0" from @mdx-js/[email protected]
npm WARN   node_modules/@storybook/addon-docs/node_modules/@mdx-js/react
npm WARN     @mdx-js/react@"^1.6.22" from @storybook/[email protected]
npm WARN     node_modules/@storybook/addon-docs
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/[email protected]
npm WARN Found: [email protected]

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"
    }
  },

Mellbourn avatar Feb 23 '23 16:02 Mellbourn

npm WARN ERESOLVE overriding peer dependency
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @storybook/[email protected]
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/[email protected]
npm ERR!   node_modules/loki/node_modules/@loki/integration-react
npm ERR!     @loki/integration-react@"^0.31.2" from [email protected]
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 [email protected]
npm ERR! node_modules/loki
npm ERR!   dev loki@"^0.31.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @storybook/[email protected]
npm ERR! node_modules/@storybook/react
npm ERR!   peerOptional @storybook/react@"^5 || ^6" from [email protected]
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 avatar Jun 05 '23 04:06 tonhao-dev

I solve this using yarn install instead of npm install

tonhao-dev avatar Jun 05 '23 20:06 tonhao-dev

Still an issue..

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @loki/[email protected]
npm WARN Found: @storybook/[email protected]
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/[email protected]
npm WARN node_modules/@loki/integration-react
npm WARN   @loki/integration-react@"^0.32.0" from [email protected]
npm WARN   node_modules/loki
npm WARN 
npm WARN Conflicting peer dependency: @storybook/[email protected]
npm WARN node_modules/@storybook/react
npm WARN   peerOptional @storybook/react@"^5 || ^6" from @loki/[email protected]
npm WARN   node_modules/@loki/integration-react
npm WARN     @loki/integration-react@"^0.32.0" from [email protected]
npm WARN     node_modules/loki
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
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 [email protected]
npm WARN node_modules/ink/node_modules/react-reconciler
npm WARN   react-reconciler@"^0.26.2" from [email protected]
npm WARN   node_modules/ink
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"^17.0.2" from [email protected]
npm WARN   node_modules/ink/node_modules/react-reconciler
npm WARN     react-reconciler@"^0.26.2" from [email protected]
npm WARN     node_modules/ink

anthodb avatar Oct 20 '23 10:10 anthodb