no I am sorry, it isn't about getting a
no I am sorry, it isn't about getting a type any but here it is : Property 'filter' does not exist on type '"" | { _id: Id<"messages">; _creationTime: number; streamId: string; chatId: Id<"chats">; role: "user" | "assistant"; content: string; isComplete: boolean; }[]'.
Property 'filter' does not exist on type '""'.ts(2339)
12 Replies
Mind sharing the query?
I think it's because it can be null
there is a conditional return, if (!chatId && !publicChatId) return ""
that is how it does start
So either use
messages?. or filter for null on your backend
Yep, filter doesn't exist for stringsokk tysm I will handle that later
maybe throwing an error
I'd just filter for null
wdym?
Oh sorry!
return null ?
Are you defining them as optional?
In your args
If so, try keeping them as string, and add an error boundary for validation
If not, return []
Empty array
that is right, for now I'll just return null filter function doesn't have any problem with that type
Sweet!
ty 😃 !