#community-help

Troubleshooting Typescript Error with Typesense

TLDR Amrit encounters a Typescript error and Jason suggests checking Typesense FieldType and importing it from 'typesense/lib/Typesense/Collections'.

Powered by Struct AI
May 09, 2023 (7 months ago)
Amrit
Photo of md5-d714a3e42b6c1a6326f383b0ecdaae8b
Amrit
06:10 PM
getting this ts error
Image 1 for getting this ts error
06:19
Jason
06:19 PM
So your code looks fine to me…
06:19
Jason
06:19 PM
Wonder if it’s something to do with an earlier version of Typescript?
Amrit
Photo of md5-d714a3e42b6c1a6326f383b0ecdaae8b
Amrit
06:31 PM
how can i import FieldType from typesense?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
06:37 PM
Something like this:

import type { FieldType } from 'typesense/lib/Typesense/Collections'
06:38
Jason
06:38 PM
But that should technically not be needed, so I suspect something is off here