Varun Singh
Varun Singh15mo ago

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?
No description
5 Replies
Varun Singh
Varun SinghOP15mo ago
No description
ian
ian15mo ago
For default exports you need to do api.competitions.listCompletions.default
Varun Singh
Varun SinghOP15mo ago
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
ian
ian15mo ago
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.function
Varun Singh
Varun SinghOP15mo ago
Got it Thank you works great now!

Did you find this page helpful?