Compile error: Type 'TConnectorParams' does not satisfy the constraint 'object'.
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?
Do you also use the latest InstantSearch.js version?
It is now packed as a dependency with this library I noticed, so it is not in my package.json
@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
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.
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!