Closed logan-jobzmall closed 5 years ago
Hi @logan-jobzmall! Thanks for reaching out.
@tkrugg I don't have a repo to clone at this point, as this is on our production code, however I can try my best to come up with a small repro project soon.
Also seems to be flagged here in TS:
@samouss is AlgoliaSearchHelper a valid type? We don't have typescript types for the helper, do we?
No we don't have type definitions for the helper. The weird thing is that it doesn't raise an error inside VSCode or even when I tried to build the library. Until we have valid type for the helper we can provide any
. The change should be safe because right now this type is only use internally. The users cannot access it from the import. We should provide those types to let users use them like this in a next release:
import { Component } from '@angular/core';
import { InstantSearchConfig } from 'angular-instantsearch';
// ...
export class AppComponent {
config: InstantSearchConfig = {
indexName: 'instant_search',
searchClient,
};
}
Thanks @samouss. ~@logan-jobzmall for now you can just set~
searchFunction: (helper: any) => void
~I'll close this issue but feel free to reopen it if there is anything more~.
My bad, this is something we need to fix in our code. Oddly enough we can't reproduce it. It seems the ng-packger thing we use for bundling the lib is swallowing some compilation errors. I'll investigate this more. Reopening.
@tkrugg - This is happening even worse now in Angular 8 CLI, and Angular Universal will not compile because of it. Any ideas?
can you give a minimal github project which gives this error? AlgoliaSearchHelper now is a type
Nevermind guys. This was my fault. I was using declare module 'algoliasearch-helper';
so I could use import * as algoliasearchHelper from 'algoliasearch-helper';
(fixing earlier issues I was having)
Hi,
I hope this isn't a n00b question. It seems as though I am running into the following error on Angular CLI while running 'ng serve':
ERROR in node_modules/angular-instantsearch/instantsearch/instantsearch.d.ts(110,31): error TS2709: Cannot use namespace 'AlgoliaSearchHelper' as a type.
I have tried uninstalling, reinstalling, clearing yarn/npm cache. Is there a way to fix this?