Convex Community

CC

Convex Community

Join the Convex Discord! Explore Convex, the fullstack TypeScript platform for developers and startup founders.

Join

support-community

show-and-tell

general

open-source

announcements

Request to Implement llms.txt on Convex.dev

What is llms.txt? Today, websites serve not only as a source of information for humans but also as a critical resource for large language models (LLMs). Language models enhance various tools, including development environments for coders, by utilizing information about programming libraries and APIs directly from website documentation. Why Implement llms.txt?...

Error in return types

I am getting the error below
Uncaught Error: Result {"data":"undefined","error":"Unauthorized"}
Uncaught Error: Result {"data":"undefined","error":"Unauthorized"}
when i call a query or a mutation simply because i am returning a Result type ```export class Result<T> { constructor( public readonly data?: T, public readonly error?: string...

corsHttpRouter

How can I get the code for the corsHttpRouter mentioned in this video? https://youtu.be/c7Y0wCml1kg?si=PPh7IPR_04Lvudg1...

Langchain & Langsmith Integration fails

We've integrated Langchain in our convex app and it's working great. But we can't get Langchain tracing to work at all. It simply does nothing on the convex backend. No errors. No logs. No traces on Langsmith. Nothing. We've integrated following these docs:...

Returning data from Tanstack Query useMutation wrapper

Maybe i'm missing something but is it not possible to return data returned from the convex tanstack query mutation wrapper? ```ts export const createDealMutation = mutation({...
No description

query inside an action

is it possible to call a query from inside an action

Should I use v.float64()?

On this page on VectorSearch it suggests using v.float64() for the embedding field, but it's not even mentioned here. I'm using zodToConvex() from convex/helpers and, therefore, don't have access to float64()....

Race condition error upon await ctx.auth.getUserIdentity();[revised post]

Business Use Case: This condition was encountered by a new joiner trying to create an account on clarity and trying to join a space. Observed Behavior: The initial code for the getById function I wrote is as follows:...
No description

Understand how Context works in test environment with Identity

Hi Everyone, I'm a bit confused about the context in my test. Here's what I'm trying to achieve: I want to check if a user can access a document created by another user. To do this:...

OTP Verification after login on Profile dashboard

We are using twillio and resend as SMS and Email services, on intial login we are verifying phone number by sending otp to the user, and google login without otp verification. Now we have built a Profile dashboard where a user can change the mobile number and email address, whenever user changes any of them I want to verify by otp. We've tried using the same TwilioOTP.sendVerificationRequest by passing the required params but its not accepting the ctx which we are trying to pass from a mutation function....

[Paginated Query] How to get the first elements in the "middle"

Context: Let's say we build a chat in a mobile app: it consists of a screen that displays messages vertically. In order to achieve this, it makes sense to have a paginated query where messages are ordered by _creationTime . Let's say a user is off for one week, have hundreds of missing messages, and open the chat. A common feature is to display the last seen message and then the new ones, and to scroll down until the most recent one. Problem: ...

Are we sure this is working?

https://github.com/get-convex/template-nextjs-convexauth-shadcn I've cloned, gone through the config steps and provided Resend, Github. For magic-link, After clicking link in email it opens sign in page in separate tab and not logged it. For Github, it complains: `Be careful! ...

Debounce calls to a mutation without doing so for the optimistic update

Say you have a text field in a Notion-like application (e.g. Fireview in screenshot) where we use optimistic updates to trigger global changes on every keystroke. In the component we use a mutation like this: ```ts const updatePage = useAuthMutation(...
No description

Next build error when ran in github action

Hello, I'm trying to create a CI workflow for my nextjs website. The problem is that I keep getting a build error from convex when running my build step. I don't have this error when I run bun run build locally though. ``` Error: No address provided to ConvexReactClient. If trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/...

Edit Panel displays previously selected document instead of current Selection

1. Choose a document, click “Edit,” and the correct document appears. 2. Close the edit panel without making any changes and unselect the document. 3. Select a second document, click “Edit,” but the first document is still displayed instead of the second one. This behavior can be confusing when navigating through the documents....
No description

[deprecated] Race condition error upon await ctx.auth.getUserIdentity();

I recently encountered a race condition issue when implementing the getById query in my application. The initial code I had written is as follows: ``` export const getById = query({ args: { id: v.id("spaces")...
No description

Debugging Clerk Webhook Issues: "session.ended" event not triggering with Convex integration

This is the project I'm currently working on and the one in question: https://github.com/LunnS2/Self-Care-App.git Currently, the "session.ended" event is not being sent or attempted, so even though I log out on the client side, "isOnline" in the Convex database stays set to true. Another event that is causing some issues is "session.created", it's not always successful. With that said, what steps can I take to debug webhook failures and ensure Clerk events fire as expected? Also, if there are any other issues or suboptimal uses of Convex that you spot in any of my files, please let me know! I want to learn about Convex best practices and ensure my app works as expected and efficiently....
No description

CustomFunctions, vitest and multiple query call in a query

Hi everyone, I'm struggling on a test. Vitest throw an error as below : ` ❯ Module.checkIfAuthorizedToCreateObject convex/validator.ts:9:15...

Full-text search across fields in different tables

I'm wondering what the easiest way is to do this? I assume I can just create a search index on a new table and use triggers to denormalize data, but maybe there's a better way...

Error: `headers` was called outside a request scope.

I recently switched devices and I wanted to continue working on my project. So I pulled all the code from github and ran convex dev. Everything seemed to be working find and even the env's got filled in as well. This project is currently running in production on vercel so I know it works. But when I try to run it I keep getting this error
Error: `headers` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context
Error: `headers` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context
...