Skip to content

peerDependency warning for search-insights #2516

@slorber

Description

@slorber

Description

When initializing a new Docusaurus site with pnpm, we get the following warning

npx create-docusaurus@latest my-website classic --javascript --package-manager pnpm
└─┬ @docusaurus/preset-classic 3.7.0
  ├─┬ @docusaurus/theme-search-algolia 3.7.0
  │ └─┬ @docsearch/react 3.9.0
  │   ├── ✕ missing peer search-insights@">= 1 < 3"
  │   └─┬ @algolia/autocomplete-core 1.17.9
  │     └─┬ @algolia/autocomplete-plugin-algolia-insights 1.17.9
  │       └── ✕ missing peer search-insights@">= 1 < 3"

Steps to reproduce

This can be reproduced outside Docusaurus:

mkdir test
cd test
pnpm init
pnpm add @docsearch/react

Image

Expected behavior

No warning

Environment

  • pnpm
  • DocSearch version: 3.9

I'm not sure why this happens considering the lib has

  "peerDependenciesMeta": {
    "search-insights": {
      "optional": true
    }
  }

Maybe this is because it depends on other Algolia packages that do not declare this peerDependency as optional? 🤷‍♂

I didn't find any ref in the doc to install the search-insights package, so I guess it's fine to only depend on this lib?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions