-
Notifications
You must be signed in to change notification settings - Fork 148
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript compile issue with addField #113
Comments
Looking at the typings for elasticlunr it looks like there's a constructor argument that determines what strings are valid to pass to So to fix your problem: interface Foo {
url: string;
}
let elasticLunrIndex = elasticlunr<Foo>(function () {
this.addField('url');
}); |
Also check out a more relaxed approach here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using elasticlunr in a typescript project. I get the following typescript compiler error when using addField:
The code:
I made sure all
strict
checking is turned off intsconfig.json
. I can workaround it for now by casting the string tonever
(whatever that means) like so:The text was updated successfully, but these errors were encountered: