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

npm install on a freshly created project produces warnings for Conflicting peer dependency #9486

Closed
6 of 7 tasks
ramnivas opened this issue Oct 31, 2023 · 5 comments · Fixed by #9566
Closed
6 of 7 tasks
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: dependencies Proposal to upgrade a dependency across major versions

Comments

@ramnivas
Copy link

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

npm install on a freshly created project produces warnings for Conflicting peer dependency.

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: flux@4.0.4
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   react@"^18.0.0" from the root project
npm WARN   31 more (@docsearch/react, @docusaurus/core, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^15.0.2 || ^16.0.0 || ^17.0.0" from flux@4.0.4
npm WARN node_modules/@microlink/react-json-view/node_modules/flux
npm WARN   flux@"~4.0.1" from @microlink/react-json-view@1.23.0
npm WARN   node_modules/@microlink/react-json-view
npm WARN 
npm WARN Conflicting peer dependency: react@17.0.2
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/@microlink/react-json-view/node_modules/flux
npm WARN     flux@"~4.0.1" from @microlink/react-json-view@1.23.0
npm WARN     node_modules/@microlink/react-json-view

Reproducible demo

No response

Steps to reproduce

  • Create a new site
npx create-docusaurus@latest my-website classic 
  • Run npm install
cd my-website
npm install

Expected behavior

No warnings produced. The site seems to work fine, but it can be confusing.

Actual behavior

Warnings produced.

Your environment

  • Public source code: (newly created Docusaurus 3.0 project)
  • Public site URL:
  • Docusaurus version used: 3.0.0
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): -
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): 18.14.1

Self-service

  • I'd be willing to fix this bug myself.
@ramnivas ramnivas 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 Oct 31, 2023
@ramnivas
Copy link
Author

npm ls --all reveals that this issue is due to @docusaurus/plugin-debug@3.0.0's dependency on flux@4.0.4 through @microlink/react-json-view@1.23.0.

│ ├─┬ @docusaurus/plugin-debug@3.0.0
│ │ ├── @docusaurus/core@3.0.0 deduped
│ │ ├── @docusaurus/types@3.0.0 deduped
│ │ ├── @docusaurus/utils@3.0.0 deduped
│ │ ├─┬ @microlink/react-json-view@1.23.0
│ │ │ ├─┬ flux@4.0.4
│ │ │ │ ├─┬ fbemitter@3.0.0
│ │ │ │ │ └── fbjs@3.0.5 deduped
│ │ │ │ ├─┬ fbjs@3.0.5
│ │ │ │ │ ├─┬ cross-fetch@3.1.8
│ │ │ │ │ │ └─┬ node-fetch@2.7.0
│ │ │ │ │ │   ├── UNMET OPTIONAL DEPENDENCY encoding@^0.1.0
│ │ │ │ │ │   └─┬ whatwg-url@5.0.0
│ │ │ │ │ │     ├── tr46@0.0.3
│ │ │ │ │ │     └── webidl-conversions@3.0.1
│ │ │ │ │ ├── fbjs-css-vars@1.0.2
│ │ │ │ │ ├── loose-envify@1.4.0 deduped
│ │ │ │ │ ├── object-assign@4.1.1 deduped
│ │ │ │ │ ├─┬ promise@7.3.1
│ │ │ │ │ │ └── asap@2.0.6
│ │ │ │ │ ├── setimmediate@1.0.5
│ │ │ │ │ └── ua-parser-js@1.0.37
│ │ │ │ └── react@18.2.0 deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux
│ │ │ ├─┬ react-base16-styling@0.6.0
│ │ │ │ ├── base16@1.0.0
│ │ │ │ ├── lodash.curry@4.1.1
│ │ │ │ ├── lodash.flow@3.5.0
│ │ │ │ └── pure-color@1.3.0
│ │ │ ├── react-dom@18.2.0 deduped
│ │ │ ├── react-lifecycles-compat@3.0.4
│ │ │ ├─┬ react-textarea-autosize@8.3.4
│ │ │ │ ├── @babel/runtime@7.23.2 deduped
│ │ │ │ ├── react@18.2.0 deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux
│ │ │ │ ├─┬ use-composed-ref@1.3.0
│ │ │ │ │ └── react@18.2.0 deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux
│ │ │ │ └─┬ use-latest@1.2.1
│ │ │ │   ├── react@18.2.0 deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux
│ │ │ │   └─┬ use-isomorphic-layout-effect@1.1.2
│ │ │ │     └── react@18.2.0 deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux

@Donorlin
Copy link

can confirm this issue, @microlink/react-json-view depends on flux@~4.0.1 that requires

"peerDependencies": {
    "react": "^15.0.2 || ^16.0.0 || ^17.0.0"
}

sadly it looks like https://github.com/facebookarchive/flux is not maintained anymore.

@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Nov 10, 2023
@homotechsual
Copy link
Contributor

Ah yeah ok - they bumped their node version requirement but that won't alter the flux transitive dep. Looks like we'll need a replacement JSON viewer for the debug plugin?

@homotechsual
Copy link
Contributor

Sorry that comment should have been on the PR #9494

@ogardnercertinia
Copy link

We install Docusaurus via pnpm with "strict peer dependencies" enabled, so this issue is currently blocking us from upgrading to version 3.

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 domain: dependencies Proposal to upgrade a dependency across major versions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants