Convex Community

CC

Convex Community

Join the community to ask questions about Convex Community and get answers from other members.

Join

support-community

show-and-tell

general

self-hosted

announcements

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
...

Fuzzy search for function names in functions panel

Would be nice 🙂 I also always assume that it works like this and only remember after my fuzzy query fails.

custom functions and getAll helper

Hi everyone🙂 , I create two custom functions to handle my queries and mutations. Now, when I use the getAll helper as below I have some strange errors. Except that I can query or mutate everything with my customFunctions. Do you have any idea what is the problem ? Did I do something wrong with my custom Functions ?...

How to register rateLimiter component in convex-test?

Haven't been able to find anything on testing docs or component specific docs for testing these components. I'm aware that they must be registered by calling t.registerComponent(), with a string name(rateLimiter), schema(can't figure how to get this from the@convex-dev/rate-limiter package), and modules(no idea either). Any guidance would be appreciated 🙂

Testing `withIdentity` in `convex-test`

Hello! I've created a custom mutation for userMutation and a custom query for userQuery which use getAuthUserId to pass along the current userId and verify that a user is authenticated. I then use these custom mutations and queries whenever I want one of my Convex functions to run with authentication for the current user. I want to write tests for these queries and mutations, and I understand I can use t.withIdentity to mock a user account. How can I get the mock id from the withIdentity user? When I try accessing it, I get a typescript error that the mocked user's id doesn't exist on Id<"users">....

dbRules functions not being triggered

I have the following: ```ts export const dbRules: Rules<AuthQueryCtx | AuthMutationCtx, DataModel> = { firestoreEdits: { insert: async (ctx, edit) => {...

Can anyone access data with CONVEX_URL without authentication setup?

Hi, I have a newbie question. I just started a Node.js project following the "Node.js Quickstart" guide. When exposing a database query like this, without any authentication restrictions, does this mean anyone can access the data if they know the CONVEX_URL? `import { query } from "./_generated/server"; export const get = query({...

Run Python script in Action?

I want to run a Python script (takes an input and returns an output, involves network calls) when users click on a button. Can I do it with Actions? If not, what are some workarounds?

Next.js 15 Convex Auth unable to login with Google OAuth

Upgrading to the new auth/core resulted in the issue. In convex logs I see - /api/auth/callback/google error '(void 0) is not a function '...

Convex Paginated Query with TanStack React Query

Is there out of the box support for Convex paginated queries with React Query? Or do we need to handle it ourselves? ``` const { data, isPending, error } = useQuery( // convexQuery(api.functions.myQuery, { id: 123 }), convexPaginatedQuery(api.functions.myPaginatedQuery, { id: 123 }), // Something like this?...

How to retrieve files from the Storage in Convex

code: ```ts export const getPackageById = query({ args: { packageId: v.id("packageTable") }, // Validate that packageId is an ID from "packageTable"...

Any idea why `NEXT_PUBLIC_CONVEX_URL` is required in a vercel deployment of using convex auth?

this caused many hours of investigation and confusion. for some reason, upon deploying from vercel (preview & prod), NEXT_PUBLIC_CONVEX_URL was required ENV. there was an application server error due to it being missing. I assume triggered via convex-auth provider. During local development, this was never needed. My local .env did not include it. I did have NEXT_PUBLIC_CONVEX_CLOUD_URL which what was used when initializing the client auth via const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_CLOUD_URL!); however, no reference to NEXT_PUBLIC_CONVEX_URL within the project....

String into ID !

That feels so simple and yet I can't manage to nail it on my code :/ Can anybody help? I have this ticketId value in a string and I just need to pass it as an argument in the correct format! What should I do?
No description