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

Resolve peer dependency warnings #6613

Closed
4 of 7 tasks
SimenB opened this issue Feb 5, 2022 · 10 comments · Fixed by #6615
Closed
4 of 7 tasks

Resolve peer dependency warnings #6613

SimenB opened this issue Feb 5, 2022 · 10 comments · Fixed by #6615
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@SimenB
Copy link
Contributor

SimenB commented Feb 5, 2022

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

Jest is currently on a slightly old version of docusaurus (jestjs/jest#12138), and when running yarn install, we get a bunch of peer dependency warnings.

➤ YN0002: │ @docsearch/react@npm:3.0.0-alpha.42 [7e41d] doesn't provide @algolia/client-search (p7108b), requested by @algolia/autocomplete-preset-algolia
➤ YN0002: │ @docusaurus/plugin-client-redirects@npm:0.0.0-4269 [fea09] doesn't provide webpack (pdfc72), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-debug@npm:0.0.0-4269 [e9f62] doesn't provide webpack (p3ea9c), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-pwa@npm:0.0.0-4269 [fea09] doesn't provide prism-react-renderer (p2b7cb), requested by @docusaurus/theme-common
➤ YN0002: │ @docusaurus/plugin-sitemap@npm:0.0.0-4269 [e9f62] doesn't provide webpack (pff6ce), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/theme-classic@npm:0.0.0-4269 [e9f62] doesn't provide webpack (p5a52d), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/theme-search-algolia@npm:0.0.0-4269 [e9f62] doesn't provide prism-react-renderer (p4f079), requested by @docusaurus/theme-common
➤ YN0002: │ @docusaurus/theme-search-algolia@npm:0.0.0-4269 [e9f62] doesn't provide webpack (p70cbc), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/utils-validation@npm:0.0.0-4269 doesn't provide react (p765b0), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/utils-validation@npm:0.0.0-4269 doesn't provide react-dom (p95574), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/utils-validation@npm:0.0.0-4269 doesn't provide webpack (p66a53), requested by @docusaurus/utils
➤ YN0060: │ jest-website@workspace:website provides react (pd4bee) with version 17.0.1, which doesn't satisfy what @docusaurus/core and some of its descendants request
➤ YN0002: │ react-dev-utils@npm:12.0.0-next.47 doesn't provide typescript (pb3be1), requested by fork-ts-checker-webpack-plugin
➤ YN0002: │ react-dev-utils@npm:12.0.0-next.47 doesn't provide webpack (pc383a), requested by fork-ts-checker-webpack-plugin

I tried to upgrade to rc.15, and there are even more warnings now 🙈

➤ YN0002: │ @docsearch/react@npm:3.0.0-alpha.42 [4b924] doesn't provide @algolia/client-search (p75cd9), requested by @algolia/autocomplete-preset-algolia
➤ YN0002: │ @docusaurus/mdx-loader@npm:2.0.0-beta.15 [91a61] doesn't provide @babel/core (p65ce8), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-client-redirects@npm:2.0.0-beta.15 [fea09] doesn't provide @babel/core (pb07c4), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-client-redirects@npm:2.0.0-beta.15 [fea09] doesn't provide webpack (pcaf69), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-content-blog@npm:2.0.0-beta.15 [5ded3] doesn't provide @babel/core (p98720), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-content-docs@npm:2.0.0-beta.15 [5ded3] doesn't provide @babel/core (pb7302), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-content-pages@npm:2.0.0-beta.15 [5ded3] doesn't provide @babel/core (p2e704), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-debug@npm:2.0.0-beta.15 [e937a] doesn't provide @babel/core (p7f869), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-debug@npm:2.0.0-beta.15 [e937a] doesn't provide webpack (p3a949), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-pwa@npm:2.0.0-beta.15 [fea09] doesn't provide prism-react-renderer (p61731), requested by @docusaurus/theme-common
➤ YN0002: │ @docusaurus/plugin-sitemap@npm:2.0.0-beta.15 [e937a] doesn't provide @babel/core (pfa245), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-sitemap@npm:2.0.0-beta.15 [e937a] doesn't provide webpack (pcf0cb), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/preset-classic@npm:2.0.0-beta.15 [fea09] doesn't provide prism-react-renderer (p08106), requested by @docusaurus/theme-common
➤ YN0002: │ @docusaurus/theme-classic@npm:2.0.0-beta.15 [e937a] doesn't provide @babel/core (pb2d91), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/theme-classic@npm:2.0.0-beta.15 [e937a] doesn't provide webpack (pa6b1d), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/theme-search-algolia@npm:2.0.0-beta.15 [e937a] doesn't provide @babel/core (pc1c1f), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/theme-search-algolia@npm:2.0.0-beta.15 [e937a] doesn't provide prism-react-renderer (p940b9), requested by @docusaurus/theme-common
➤ YN0002: │ @docusaurus/theme-search-algolia@npm:2.0.0-beta.15 [e937a] doesn't provide webpack (p33182), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/utils-validation@npm:2.0.0-beta.15 [91a61] doesn't provide @babel/core (p6b1bc), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/utils-validation@npm:2.0.0-beta.15 [91a61] doesn't provide webpack (pf17d7), requested by @docusaurus/utils
➤ YN0060: │ jest-website@workspace:website provides react (pe7f74) with version 17.0.1, which doesn't satisfy what @docusaurus/core and some of its descendants request
➤ YN0002: │ react-dev-utils@npm:12.0.0 doesn't provide typescript (p08c91), requested by fork-ts-checker-webpack-plugin
➤ YN0002: │ react-dev-utils@npm:12.0.0 doesn't provide webpack (pf80ce), requested by fork-ts-checker-webpack-plugin

Steps to reproduce

  1. Clone https://github.com/facebook/jest
  2. Run yarn

Expected behavior

Only a single peer dependency warning from jscodeshift

Actual behavior

10+ peer warnings from docusaurus

Your environment

Reproducible demo

No response

Self-service

  • I'd be willing to fix this bug myself.
@SimenB SimenB 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 Feb 5, 2022
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed status: needs triage This issue has not been triaged by maintainers labels Feb 5, 2022
@Josh-Cena
Copy link
Collaborator

Hey @SimenB This has been fixed in #6498 already! Maybe try the latest canary release again? :D

We are migrating to Berry as well in #6028, not sure if it will make things better in the future

@SimenB
Copy link
Contributor Author

SimenB commented Feb 5, 2022

0.0.0-4556 is better! Still a bunch of warning, tho

➤ YN0002: │ @docsearch/react@npm:3.0.0-alpha.42 [1772f] doesn't provide @algolia/client-search (p955b8), requested by @algolia/autocomplete-preset-algolia
➤ YN0002: │ @docusaurus/plugin-client-redirects@npm:0.0.0-4556 [fea09] doesn't provide @babel/core (p664fa), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-client-redirects@npm:0.0.0-4556 [fea09] doesn't provide @babel/core (p9c656), requested by @docusaurus/utils-validation
➤ YN0002: │ @docusaurus/plugin-client-redirects@npm:0.0.0-4556 [fea09] doesn't provide webpack (p84d55), requested by @docusaurus/utils
➤ YN0002: │ @docusaurus/plugin-client-redirects@npm:0.0.0-4556 [fea09] doesn't provide webpack (p86920), requested by @docusaurus/utils-validation
➤ YN0002: │ @docusaurus/plugin-pwa@npm:0.0.0-4556 [fea09] doesn't provide prism-react-renderer (pd77e8), requested by @docusaurus/theme-common
➤ YN0002: │ jest-website@workspace:website doesn't provide prism-react-renderer (pd78d7), requested by @docusaurus/preset-classic
➤ YN0060: │ jest-website@workspace:website provides react (p6298b) with version 17.0.1, which doesn't satisfy what @docusaurus/core and some of its descendants request
➤ YN0002: │ jest-website@workspace:website doesn't provide webpack (p271f3), requested by @docusaurus/preset-classic
➤ YN0002: │ react-dev-utils@npm:12.0.0 doesn't provide typescript (p08c91), requested by fork-ts-checker-webpack-plugin
➤ YN0002: │ react-dev-utils@npm:12.0.0 doesn't provide webpack (pf80ce), requested by fork-ts-checker-webpack-plugin

It seems odd to me that I need to provide prism-react-renderer or webpack. Mismatching react version is unfortunate ( @mdx-js/runtime@npm:1.6.22 [8bb6f] → ^16.13.1)

@Josh-Cena
Copy link
Collaborator

Oh, @mdx-js/runtime is supposed to be removed from the dependencies, forgot about that...

As for the client redirect plugin, I'm afraid not many people use it so they haven't complained😆 Will fix that as well

As for webpack or prism-react-renderer, I'll look into them. Since we actually have an E2E test running in PnP strict mode, I'm not sure where went wrong.

@Josh-Cena Josh-Cena reopened this Feb 5, 2022
@Josh-Cena Josh-Cena removed the closed: duplicate This issue or pull request already exists in another issue or pull request label Feb 5, 2022
@SimenB
Copy link
Contributor Author

SimenB commented Feb 5, 2022

Sweet, thank you!

@Josh-Cena
Copy link
Collaborator

I'm not sure about the business with webpack. This whole thing around peer dependencies seems dangerous to touch... Let's see if E2E breaks after I move that...

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Feb 5, 2022

Tests seem good. Here're the latest results from E2E tests:

  ➤ YN0002: │ @docsearch/react@npm:3.0.0-alpha.50 [7963c] doesn't provide @algolia/client-search (p397c1), requested by @algolia/autocomplete-preset-algolia
  ➤ YN0002: │ react-dev-utils@npm:12.0.0 doesn't provide typescript (p08c91), requested by fork-ts-checker-webpack-plugin
  ➤ YN0002: │ react-dev-utils@npm:12.0.0 doesn't provide webpack (pf80ce), requested by fork-ts-checker-webpack-plugin

At this point... You would need to use package extensions for the rest. As for prism-react-renderer, since you have customized your code blocks' theme, I suggest you actually declare it as dependency. But removing it shouldn't trigger warnings, either.

@SimenB
Copy link
Contributor Author

SimenB commented Feb 5, 2022

Thanks! I guess we could open issues with CRA and @docsearch/react

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Feb 5, 2022

algolia/docsearch#1272
facebook/create-react-app#11914

I wonder how soon the CRA one can be merged though, traffic in that repo is insane

@SimenB
Copy link
Contributor Author

SimenB commented Feb 15, 2022

@Josh-Cena I tried updating to latest canary now. Getting a new one, otherwise looks good 👍

➤ YN0002: │ @docusaurus/plugin-pwa@npm:0.0.0-4591 [fea09] doesn't provide @babel/core (p814f8), requested by @babel/preset-env
➤ YN0002: │ @docusaurus/plugin-pwa@npm:0.0.0-4591 [fea09] doesn't provide @babel/core (pe5f3c), requested by babel-loader

@Josh-Cena
Copy link
Collaborator

Oh, that was a minor regression unnoticed. Thanks for reporting @SimenB

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants