Skip to content

fix: move docusaurus core back to hard dependencies#6078

Merged
slorber merged 4 commits intofacebook:mainfrom
pranabdas:main
Dec 10, 2021
Merged

fix: move docusaurus core back to hard dependencies#6078
slorber merged 4 commits intofacebook:mainfrom
pranabdas:main

Conversation

@pranabdas
Copy link
Contributor

While upgrading to latest beta 10, it gives @docusaurus/core peer dependency error due to different versions required by @docusaurus/preset-classic and root @docusaurus/core. Current canary release seems broken as well because of this inconsistent requirements.

Motivation

Trying to fix the peer dependency error while upgrading to the latest beta 10.

Details of error:

$ npm i @docusaurus/core@latest @docusaurus/preset-classic@latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: XXXXXXXX@0.2.1
npm ERR! Found: @docusaurus/core@2.0.0-beta.10
npm ERR! node_modules/@docusaurus/core
npm ERR!   @docusaurus/core@"2.0.0-beta.10" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @docusaurus/core@"2.0.0-beta.9" from @docusaurus/preset-classic@2.0.0-beta.10
npm ERR! node_modules/@docusaurus/preset-classic
npm ERR!   @docusaurus/preset-classic@"2.0.0-beta.10" 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/XXXX/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/XXXX/.npm/_logs/2021-12-XXXX_30_21_115Z-debug.log

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Sorry, I don't know how to test npm releases.

While upgrading to latest beta 10, it gives @docusaurus/core peer dependency error due to different versions required by @docusaurus/preset-classic and root @docusaurus/core. Current canary release seems broken as well because of this inconsistent requirements for @docusaurus/preset-classic and root @docusaurus/core.
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 9, 2021
@netlify
Copy link

netlify bot commented Dec 9, 2021

✔️ [V2]

🔨 Explore the source changes: 098369d

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61b3233fb2594000071c9f9c

😎 Browse the preview: https://deploy-preview-6078--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Dec 9, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 76
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-6078--docusaurus-2.netlify.app/

},
"peerDependencies": {
"@docusaurus/core": "2.0.0-beta.9",
"@docusaurus/core": "2.0.0-beta.10",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should make it an range? ^2.0.0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think ranges work for beta tags. But I could be wrong

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caret ranges do work: https://docs.npmjs.com/cli/v6/using-npm/semver#prerelease-tags

I will probably be going for a range, because if lerna doesn't want to update peer dependencies (#6047 (comment)) we'd have to make it future-proof

@Josh-Cena Josh-Cena changed the title Fixes @docusaurus/core peer dependency fix: properly declare peer dependency versions Dec 10, 2021
@Josh-Cena Josh-Cena changed the title fix: properly declare peer dependency versions fix: move docusaurus core back to hard dependencies Dec 10, 2021
@slorber
Copy link
Collaborator

slorber commented Dec 10, 2021

For now I'm reverting the peerDep to a regular dep (how it used to be)

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Dec 10, 2021
@slorber slorber merged commit fbf04ed into facebook:main Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants