angular-instantsearch icon indicating copy to clipboard operation
angular-instantsearch copied to clipboard

Compile error: Type 'TConnectorParams' does not satisfy the constraint 'object'.

Open bashoogzaad opened this issue 4 years ago • 5 comments

I currently have the following error while compiling an Angular 12 app and Angular Instantsearch 4.0.1:

Error: node_modules/angular-instantsearch/typed-base-widget.d.ts:17:59 - error TS2344: Type 'TConnectorParams' does not satisfy the constraint 'object'. 17 createWidget(connector: Connector<TWidgetDescription, TConnectorParams>, options: TConnectorParams): void;

Any idea how to solve this?

bashoogzaad avatar Oct 20 '21 10:10 bashoogzaad

Do you also use the latest InstantSearch.js version?

Haroenv avatar Oct 20 '21 12:10 Haroenv

It is now packed as a dependency with this library I noticed, so it is not in my package.json

bashoogzaad avatar Oct 20 '21 12:10 bashoogzaad

@dhayab, this sounds related to the latest fix you did. In the mean time while we investigate why there's this mismatch @bashoogzaad, you can use 4.0.0

Haroenv avatar Oct 20 '21 12:10 Haroenv

Hi, the 4.0.1 version of angular-instantsearch should in fact address the typing issue you're having.

Could you verify the versions of angular-instantsearch and instantsearch.js that are actually installed?

With yarn you can use yarn why angular-instantsearch, otherwise you can get the version from the installed dependency's package.json like this:

cat node_modules/angular-instantsearch/package.json | grep version

If you find an inconsistency, you can reinstall your dependencies by deleting your node_modules directory and performing yarn or npm install in your terminal.

You can also start from a fresh template by using create-instantsearch-app with the following command:

npx create-instantsearch-app my-project-directory --template "Angular InstantSearch"

Let me know if that works for you.

dhayab avatar Oct 20 '21 13:10 dhayab

Thanks for your comments. Version 4.0.0 is working for me. I had installed the 4.0.1 version and the version of instantsearch.js was auto installed (it was not in my package.json). I already deleted the node_modules and reinstalled them. But I will try that again!

bashoogzaad avatar Oct 20 '21 13:10 bashoogzaad