mohux / react-brackets

Reusable and customizable react brackets component, you can use it to build components such as single elimination, or double elimination brackets
105 stars 47 forks source link

latest version 0.4.7 not working with react 18 #22

Open DoomTaper opened 1 year ago

DoomTaper commented 1 year ago

getting below error while running npm ci

next_blix_gg git:(main) npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: react-brackets@0.4.7
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   react@"18.2.0" from the root project
npm ERR!   peer react@">=18" from @chakra-ui/accordion@2.1.2
npm ERR!   node_modules/@chakra-ui/accordion
npm ERR!     @chakra-ui/accordion@"2.1.2" from @chakra-ui/react@2.3.7
npm ERR!     node_modules/@chakra-ui/react
npm ERR!       @chakra-ui/react@"^2.3.7" from the root project
npm ERR!       1 more (chakra-ui-markdown-renderer)
npm ERR!   89 more (@chakra-ui/alert, @chakra-ui/checkbox, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0" from react-brackets@0.4.7
npm ERR! node_modules/react-brackets
npm ERR!   react-brackets@"^0.4.7" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@17.0.2
npm ERR! node_modules/react
npm ERR!   peer react@"^17.0.0" from react-brackets@0.4.7
npm ERR!   node_modules/react-brackets
npm ERR!     react-brackets@"^0.4.7" 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 /Users/ayushsingh/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ayushsingh/.npm/_logs/2022-12-09T09_54_03_918Z-debug-0.log
➜  next_blix_gg git:(main) 

Below is my package.json

{
  "name": "app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@chakra-ui/react": "^2.3.7",
    "@emotion/react": "^11.10.5",
    "@emotion/styled": "^11.10.5",
    "chakra-ui-markdown-renderer": "^4.1.0",
    "framer-motion": "^6.5.1",
    "gray-matter": "^4.0.3",
    "markdown-it": "^12.3.2",
    "next": "13.0.1",
    "react": "18.2.0",
    "react-brackets": "^0.4.7",
    "react-dom": "18.2.0",
    "react-icons": "^4.6.0",
    "react-swipeable-views": "^0.14.0"
  }
}
Oliver-Looney commented 1 year ago

https://github.com/mohux/react-brackets/pull/27 pr should fix this issue

snzow commented 1 year ago

for now just npm install --save react-brackets --legacy-peer-deps

josefsjunior commented 3 months ago

Tks @snzow , This worked for me