Utils cannot find react module #5800
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
closed: duplicate
This issue or pull request already exists in another issue or pull request
🐛 Bug Report
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
I have a theme package that I test through an example docusaurus instance (which is basically borrowed from here). The example instance lives inside the them package
/example
.For testing purposes, I require the package with a symlink which gives me flexibility while developing, in my
docusaurus.config.js
:However, I recently updated the
@docusaurus/utils-validation
package from2.0.0-beta.6
to2.0.0-beta.8
and runningIt seems to come down to this recently introduced change #4330
I also tried to make react a dependency but it ends up loaded twice and makes everything fail.
Steps to reproduce
joi
imported from@docusaurus/utils-validation
yarn build
Expected behavior
The example website would build without error.
Actual behavior
yarn build
in example instance gives me this issue:Your environment
Reproducible demo
Since my code isn't public and you don't have a theme/plugin template available for me to test if it's tied to my code or to produce a demo, those are the more or like the reproducible steps.
Create a package with the following dependencies:
index.js
:Validate it by importing
joi
as follow:Then create an example application within the new package folder:
Update the
docusaurus.config.js
to include the parent package:The text was updated successfully, but these errors were encountered: