docs: improve troubleshooting (#1739)

* docs: improve troubleshooting

* fixes
This commit is contained in:
Shahed Nasser
2022-06-27 16:57:24 +03:00
committed by GitHub
parent 6566bc1cf6
commit 1cc4f9ac2d
6 changed files with 78 additions and 46 deletions

View File

@@ -1,7 +1,7 @@
# Documentation Error
If you have installed the dependencies in the root of this repository (i.e., if you have a `node_modules` directory at the root of this repository), this will cause an error when running this documentation website. This is because the content resides in `docs/content` and when that content is being imported from there, a mix up can happen between the dependencies which will cause an `invalid hook call` error.
If you have installed the dependencies in the root of the Medusa repository (i.e., if you have a `node_modules` directory at the root of the Medusa repository), this will cause an error when running the documentation website.
For that reason, we added a `clean-node-modules` script that deletes the `node_modules` directory, and we call that script before the `start` and `build` scripts are ran.
This is because the content resides in `docs/content`. When that content is being imported from there, a mix up can happen between the dependencies in the root of the Medusa repository and the dependencies in `www/docs` which causes an `invalid hook call` error.
So, everytime you run these 2 scripts, the `node_modules` directory at the root will be deleted.
For that reason, when the `start` and `build` scripts in `www/docs` are used, the `clean-node-modules` script is called. This script deleted the `node_modules` directory in the root of the Medusa repository.