Convex front-end error: Could not find public function
I am getting an error that a public function (Convex function) could not be found. I verified that it's there and I restarted both front-end and backend, and my computer. I am running a useQuery on a convex function inside of a module. I am not getting this for any other functions in the module. The module is "competitions" and each file is the name of the function, and inside each file I have an "export default" for a query or mutation. Any ideas on why I am getting this error?

5 Replies

For default exports you need to do
api.competitions.listCompletions.default
Oh okay, I thought this was only used when the file is not inside a folder. Are modules usually a single file instead? Like if I put all of my functions into a competition.ts and exported them like that
Yeah that’s how I’d do it.
export const listCompletions =
…
It can be in a folder but it still needs the last element to be the function, not file
api.folder.folder.file.functionGot it
Thank you works great now!