Occasional onvex error:
Unhandled Runtime Error
Error: [CONVEX Q(essays:getByEssayId)] Uncaught Error: Essay not found
at handler (../convex/essays.ts:120:4)
Called by client
I get this error from time to time, not always. It happens when I delete a document.3 Replies
It sounds like you are querying for that essay from somewhere when it is deleted. That looks like an error that you throw.
When it’s deleted it’ll refresh any query that fetched / would fetch it
when i delete a document, the page redirects back to the main page, usually. However, the error I mentioned happens from time to time, thats why I think this error has something to do with convex.. If not, then I don't know what might be causing this issue to appear ocassionally
It seems like it's a page that has a reference to an Essay and is passing an invalid essay ID to
getByEssayId
, so I'd look at your client code. It's likely a race of the state updating and the client updating. I would add logging and figure out who is making the request and whether the ID should have been valid then. Or change your getEssayById
to return null
when it's missing, to handle that on the client side