You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument of type '{ name: string; fields: { name: string; type: string; facet: boolean; }[]; }' is not assignable to parameter of type 'CollectionCreateSchema'.
Types of property 'fields' are incompatible.
Type '{ name: string; type: string; facet: boolean; }[]' is not assignable to type 'CollectionFieldSchema[]'.
Type '{ name: string; type: string; facet: boolean; }' is not assignable to type 'CollectionFieldSchema'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type 'FieldType'.
That said, is there a way to fix this issue in the typesense TS library, so users don't have to explicitly use the as const? I'm not a Typescript expert, so I'd appreciate a PR for this.
Description
The JS example here: https://typesense.org/docs/26.0/api/collections.html#with-pre-defined-schema
Throws an error with used with TypeScript v3.4.
The error is similar to:
It boils down to: https://stackoverflow.com/a/37978675
How to solve it
Please add a note about that issue, or provide the following as an example:
The text was updated successfully, but these errors were encountered: