From e15941f0024c815bce3f5ca2bdf0bdf45bb2b86e Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 30 Jun 2022 19:58:22 +0530 Subject: [PATCH] docs: add workaround for missing peer dependencies (#882) --- docs/guide/getting-started.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index b751b33c..6bf5b20c 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -28,6 +28,39 @@ Add VitePress and Vue as dev dependencies for the project. $ yarn add --dev vitepress vue ``` +::: details Getting missing peer deps warnings? +`@docsearch/js` has certain issues with its peer dependencies. If you see some commands failing due to them, you can try this workaround for now: + +On Yarn v2/v3, add this inside your rc file (`.yarnrc.yml` by default): + +```yaml +packageExtensions: + '@docsearch/react@*': + peerDependenciesMeta: + '@types/react': + optional: true + 'react': + optional: true + 'react-dom': + optional: true +``` + +On PNPM, add this in your `package.json`: + +```json +"pnpm": { + "peerDependencyRules": { + "ignoreMissing": [ + "@types/react", + "react", + "react-dom" + ] + } +} +``` + +::: + Create your first document. ```bash