#Type problems with Convex functions in NextJS

7 messages · Page 1 of 1 (latest)

lethal shore
#

I'm trying to use Convex functions with NextJS and I'm running into multiple type problems that I'm unable to solve. First, some namespaces under api have only a generic record type and no functions are available. If I try to use those that have functions in them, I get just any as the return type from fetchQuery. Does anybody know what may be the problem here?

vernal raptor
lethal shore
#

I can send more of the code tomorrow, but yeah, I'm trying to use it in the actual next code, not in the Convex folder

vernal raptor
#

the vast majority of people here use "use client" at the top of the page with useQuery() useMutation() etc. Especially if you are just getting into convex. I still haven't used fetchQuery and ive been using convex daily for over a year 😅

lethal shore
#

I'm migrating to Convex an app that used Neon before and I'm using UploadThing for file uploads, I don't want to migrate this away and I need to store the file references in Convex somehow. In UploadThing you need to write a function that would serve as a webhook when the upload is done, so you can store that in the DB. But actually I think that using useQuery wouldn't help even if I could use it, because of the strange types of the api object.

lethal shore
#

Isn't there someone who would know what could be the cause?

charred tree
#

When running npx convex dev do you get any errors?