autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

`yarn add @algolia/autocomplete-js` produces a bunch of unmet peer dependency warnings

Open Philostastically opened this issue 1 year ago • 2 comments

Description

Maybe there's something specific about my project, but when I add @algolia/autocomplete-js I get a bunch of "unmet peer dependency" warnings. I get the same warnings with a new project. Maybe these warnings are intentional but they seem pretty unfriendly and should be fixed, imo.

Reproduction

Steps

  1. Create a new project.
  2. Run yarn init
  3. Run yarn add @algolia/autocomplete-js
  4. Received output
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The engine "pnpm" appears to be invalid.
[3/4] Linking dependencies...
warning "workspace-aggregator-8d0bd819-678b-4381-8a21-4e795aadea2f > frontend > @algolia/[email protected]" has unmet peer dependency "@algolia/client-search@>= 4.5.1 < 6".
warning "workspace-aggregator-8d0bd819-678b-4381-8a21-4e795aadea2f > frontend > @algolia/[email protected]" has unmet peer dependency "algoliasearch@>= 4.9.1 < 6".
warning "workspace-aggregator-8d0bd819-678b-4381-8a21-4e795aadea2f > frontend > @algolia/autocomplete-js > @algolia/[email protected]" has unmet peer dependency "@algolia/client-search@>= 4.9.1 < 6".
warning "workspace-aggregator-8d0bd819-678b-4381-8a21-4e795aadea2f > frontend > @algolia/autocomplete-js > @algolia/[email protected]" has unmet peer dependency "algoliasearch@>= 4.9.1 < 6".
warning "workspace-aggregator-8d0bd819-678b-4381-8a21-4e795aadea2f > frontend > @algolia/autocomplete-js > @algolia/[email protected]" has unmet peer dependency "@algolia/client-search@>= 4.9.1 < 6".
warning "workspace-aggregator-8d0bd819-678b-4381-8a21-4e795aadea2f > frontend > @algolia/autocomplete-js > @algolia/[email protected]" has unmet peer dependency "algoliasearch@>= 4.9.1 < 6".
warning "workspace-aggregator-8d0bd819-678b-4381-8a21-4e795aadea2f > frontend > @algolia/autocomplete-js > @algolia/autocomplete-core > @algolia/[email protected]" has unmet peer dependency "search-insights@>= 1 < 3".
[4/4] Building fresh packages...
Done in 3.88s.

Expected behavior

No warnings should be thrown.

Environment

  • OS: Linux
  • Autocomplete version: v1.11.1

Philostastically avatar Oct 18 '23 18:10 Philostastically

I'm not sure how we can solve this, but you should install algoliasearch before or right after installing autocomplete. Normally most information should already be updated with npm install algoliasearch @algolia/autocomplete-js. If you copied from somewhere that doesn't have that, I'd gladly fix it

Haroenv avatar Oct 19 '23 08:10 Haroenv

I mean, the readme of this repo (at least on the next branch, which is default) says you should install the package with

yarn add @algolia/autocomplete-js
# or
npm install @algolia/autocomplete-js

If that's not the right way for someone looking to install this project to get started it should say that. Additionally, the project will still warn about unmet peer dependencies. You still need to install @algolia/client-search and search-insights. I get that those are required by projects that aren't this one, but I think they should be either included as dependencies for this project, or at least included in the documentation of how to install this project.

Philostastically avatar Oct 19 '23 13:10 Philostastically