NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.77k stars 554 forks source link

react-lazy-images peer dependency conflicts for react-18 #438

Open kashifshaikh opened 1 year ago

kashifshaikh commented 1 year ago

Description

When installing react-notion-x, once of it's dependencies react-lazy-images gets conflicts with react-18 (for nextjs-13)

I fixed this in package.json by adding an override to force peer dependency for now:

 "overrides": {
    "react-notion-x": {
      "react": "^18.2.0",
      "react-dom": "^18.2.0"
    }
  }

These are the errors I get

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-lazy-images@1.1.0
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.2.0" from the root project
npm WARN   19 more (@headlessui/react, @heroicons/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^15 || ^16" from react-lazy-images@1.1.0
npm WARN node_modules/react-notion-x/node_modules/react-lazy-images
npm WARN   react-lazy-images@"^1.1.0" from react-notion-x@6.16.0
npm WARN   node_modules/react-notion-x
npm WARN 
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN   peer react@"^15 || ^16" from react-lazy-images@1.1.0
npm WARN   node_modules/react-notion-x/node_modules/react-lazy-images
npm WARN     react-lazy-images@"^1.1.0" from react-notion-x@6.16.0
npm WARN     node_modules/react-notion-x
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-intersection-observer@6.4.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   19 more (@headlessui/react, @heroicons/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^15.0.0 || ^16.0.0 || ^17.0.0" from react-intersection-observer@6.4.2
npm WARN node_modules/react-notion-x/node_modules/react-lazy-images/node_modules/react-intersection-observer
npm WARN   react-intersection-observer@"^6.1.0" from react-lazy-images@1.1.0
npm WARN   node_modules/react-notion-x/node_modules/react-lazy-images
npm WARN 
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^15.0.0 || ^16.0.0 || ^17.0.0" from react-intersection-observer@6.4.2
npm WARN   node_modules/react-notion-x/node_modules/react-lazy-images/node_modules/react-intersection-observer
npm WARN     react-intersection-observer@"^6.1.0" from react-lazy-images@1.1.0
npm WARN     node_modules/react-notion-x/node_modules/react-lazy-images

When I goto react-lazy-images, it seems author updated the peer dependencies to react-18 and bumped up react-intersection-observer to latest one which (which supports react-18) 4 months ago, however the author hasn't released/published the newer npm yet.

predam commented 1 year ago

I have encountered the same issue Can someone update this dep?