Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peer dependency conflict with react-json-view in docusaurus@3.0.0-alpha.0 #9105

Closed
5 of 7 tasks
noomorph opened this issue Jun 26, 2023 · 2 comments · Fixed by #9116
Closed
5 of 7 tasks

Peer dependency conflict with react-json-view in docusaurus@3.0.0-alpha.0 #9105

noomorph opened this issue Jun 26, 2023 · 2 comments · Fixed by #9116
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.
Milestone

Comments

@noomorph
Copy link
Contributor

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

While testing 3.0.0-alpha.0, a warning popped up regarding the overriding of a peer dependency. Here's the warning I encountered:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-json-view@1.21.3
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   peerOptional react@">= 16.8.0 < 19.0.0" from @docsearch/react@3.5.1
npm WARN   node_modules/@docsearch/react
npm WARN     @docsearch/react@"^3.3.3" from @docusaurus/theme-search-algolia@3.0.0-alpha.0
npm WARN     node_modules/@docusaurus/theme-search-algolia
npm WARN   33 more (@docusaurus/core, @docusaurus/mdx-loader, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^17.0.0 || ^16.3.0 || ^15.5.4" from react-json-view@1.21.3
npm WARN node_modules/react-json-view
npm WARN   react-json-view@"^1.21.3" from @docusaurus/plugin-debug@3.0.0-alpha.0
npm WARN   node_modules/@docusaurus/plugin-debug

Reproducible demo

No response

Steps to reproduce

  1. Start with a fresh installation.
  2. Patch package.json to use 3.0.0-alpha.0:
  "dependencies": {
    "@docusaurus/core": "3.0.0-alpha.0",
    "@docusaurus/preset-classic": "3.0.0-alpha.0",
    "@mdx-js/react": "^2.0.0",
    "clsx": "^1.2.1",
    "prism-react-renderer": "^2.0.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  },
  "devDependencies": {
    "@docusaurus/module-type-aliases": "3.0.0-alpha.0"
  },
  1. Run npm install

Expected behavior

Installation should pass without warnings.

Actual behavior

I see these warnings:

npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-json-view@1.21.3
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   peer react@"^15.0.2 || ^16.0.0 || ^17.0.0" from flux@4.0.4
npm WARN   node_modules/react-json-view/node_modules/flux
npm WARN     flux@"^4.0.1" from react-json-view@1.21.3
npm WARN     node_modules/react-json-view
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^17.0.0 || ^16.3.0 || ^15.5.4" from react-json-view@1.21.3
npm WARN node_modules/react-json-view
npm WARN   react-json-view@"^1.21.3" from @docusaurus/plugin-debug@3.0.0-alpha.0
npm WARN   node_modules/@docusaurus/plugin-debug
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^17.0.0 || ^16.3.0 || ^15.5.4" from react-json-view@1.21.3
npm WARN   node_modules/react-json-view
npm WARN     react-json-view@"^1.21.3" from @docusaurus/plugin-debug@3.0.0-alpha.0
npm WARN     node_modules/@docusaurus/plugin-debug
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-json-view@1.21.3
npm WARN Found: react-dom@18.2.0
npm WARN node_modules/react-dom
npm WARN   react-dom@"^18.0.0" from the root project
npm WARN   18 more (@docusaurus/core, @docusaurus/module-type-aliases, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^17.0.0 || ^16.3.0 || ^15.5.4" from react-json-view@1.21.3
npm WARN node_modules/react-json-view
npm WARN   react-json-view@"^1.21.3" from @docusaurus/plugin-debug@3.0.0-alpha.0
npm WARN   node_modules/@docusaurus/plugin-debug
npm WARN
npm WARN Conflicting peer dependency: react-dom@17.0.2
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^17.0.0 || ^16.3.0 || ^15.5.4" from react-json-view@1.21.3
npm WARN   node_modules/react-json-view
npm WARN     react-json-view@"^1.21.3" from @docusaurus/plugin-debug@3.0.0-alpha.0
npm WARN     node_modules/@docusaurus/plugin-debug
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility

Your environment

  • Docusaurus version used: 3.0.0-alpha.0
  • Environment name and version: Node.js 16.20.0, npm 8.19.4
  • Operating system and version: MacOS 12.5.1

Self-service

  • I'd be willing to fix this bug myself.
@noomorph noomorph added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jun 26, 2023
@noomorph
Copy link
Contributor Author

Looks like react-json-view will remain in React 17 and forks like https://github.com/YYsuni/react18-json-view begin to appear ... Is it something that will be solved in 3.0.0-alpha.1 ?

@slorber
Copy link
Collaborator

slorber commented Jun 29, 2023

Thanks for reporting

Yes we want to fix it, not sure how yet.

Original issue with a good amount of alternatives mentioned: mac-s-g/react-json-view#403

@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Jun 29, 2023
@slorber slorber added this to the 3.0.0 milestone Jun 29, 2023
@Josh-Cena Josh-Cena added the external This issue is caused by an external dependency and not Docusaurus. label Jun 30, 2023
@slorber slorber modified the milestones: 3.x+, 3.0 Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution external This issue is caused by an external dependency and not Docusaurus.
Projects
None yet
3 participants