Repository navigation
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its execution
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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
When trying to link @docusaurus/preset-classic into a sample repo, I get this issue:
npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @testing-library/[email protected]
npm ERR! Found: @types/[email protected]
npm ERR! node_modules/@types/react
npm ERR! dev @types/react@"^18.0.28" from the root project
npm ERR! @types/react@"*" from @docusaurus/[email protected]
npm ERR! packages/docusaurus-module-type-aliases
npm ERR! @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/module-type-aliases
npm ERR! workspace packages/docusaurus-module-type-aliases from the root project
npm ERR! 10 more (docusaurus-2-classic-typescript-template, ...)
npm ERR! 3 more (@docusaurus/theme-common, @docusaurus/types, @types/react-test-renderer)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @types/react@"^16.9.0 || ^17.0.0" from @testing-library/[email protected]
npm ERR! node_modules/@testing-library/react-hooks
npm ERR! dev @testing-library/react-hooks@"^8.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @types/[email protected]
npm ERR! node_modules/@types/react
npm ERR! peerOptional @types/react@"^16.9.0 || ^17.0.0" from @testing-library/[email protected]
npm ERR! node_modules/@testing-library/react-hooks
npm ERR! dev @testing-library/react-hooks@"^8.0.1" 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.
If we look at the library in question: React-hooks-testing-library
We see this line: "@types/react": "^16.9.0 || ^17.0.0",
Which conflicts with the root package.json: "@types/react": "^18.0.28",
Reproducible demo
No response
Steps to reproduce
- Start a sample project, using the documentation
- Run
npm linkin docusaurus/package/docusaurus-preset-classic` - Observe errors :(
Expected behavior
We should be able to npm link into the repo without issues.
Actual behavior
Error in description
Your environment
- Public source code:
- Public site URL:
- Docusaurus version used: "3.0.0-alpha.0"
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):
Self-service
- I'd be willing to fix this bug myself.
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its execution
Activity
robert-j-webb commentedon May 26, 2023
I worked around this by deleting the
"@testing-library/react-hooks": "^8.0.1",line from the main package.json. I suppose tests won't compile but it's fine for my use caseslorber commentedon May 30, 2023
The package itself recommends to use another package with React 18:
Considering we are also upgrading to React 18, I'll consider this issue will be fixed as part of the upgrade (#9013)
The solution will be to not use this package anymore
[-]Dependency issue with react-tyeps[/-][+]testing-library - Dependency issue with react-types[/+]