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

Convext Ent - Custom Error Message

I'm using convex -ents to define my schema. is there other way to have a customer message if error happens like this code below ?
defineEnt({}).field('email', v.string(), {unique: true}) - i want to have a message if email is not unique.
defineEnt({}).field('email', v.string(), {unique: true}) - i want to have a message if email is not unique.
...

Using Convex query gives Cannot find module '@/convex/_generated/api'

I am working on a Next.js convex project and I am having some trouble with running a query. The project has these dirs app, convex and models. app contains the next js app, and the models has some ts code to interact with ai models in the models dir I am trying to run this query
const activePrompt = await useQuery(api.prompts.getActivePrompt);
const activePrompt = await useQuery(api.prompts.getActivePrompt);
which runs against this table ```prompts: defineTable({ promptId: v.id("prompts"),...

Run convex from AWS lambda

I have next JS application with convex back-end. I want to run my scalable code on AWS lambdas. At first I wanted to use queues and pass data to the lambdas like that. Then I thought it might be simpler to just let each lambda access convex directly. My convex folder is generated on my next JS project (The lambda code is a sub-project of that project) ...

Unable to push Convex functions `Function execution timed out`

The full error I'm getting is: ``` Error fetching POST https://sensible-salmon-524.convex.cloud/api/push_config 400 Bad Request: InvalidModules: Hit an error while pushing: Loading the pushed modules encountered the following error:...

Advice on Convex & OpenAI Assistants API: Real-Time Reactivity, Data Redundancy, & Collaborative UX

I came across Ian Macartney’s post, "GPT Streaming With Persistent Reactivity," while exploring patterns for using Convex with OpenAI. Since the post is over a year old, I wanted to ask if the team has any new insights, particularly around collaborative user experiences powered by Convex and the OpenAI Assistants API. While I was thinking about it, I felt uncomfortable about the idea of having two sources of truth. The Assistants API already stores a lot of information about threads, messages, and tool calls. It feels redundant to store the same information in Convex if I can access it through the API. However, as Ian mentioned, browser-based HTTP streaming alone is unreliable for real-time reactivity, especially in a collaborative multi-user environment. A real-time database solution like Convex seems essential to achieve the required synchronization....

Paginated query with Tanstack Query

Is there any way to use paginated queries with Tanstack query?

Optional One-To-Many Issue - Ents

Hello! First I want to say I am loving using Convex, so thank you for creating such a fantastic product with a wonderful developer experience. I have read through the issues relating to this and I just want to get final confirmation that what I'm trying to do is not currently possible, and that I am correct about the recommended approach if I am using Ents. ```...

Is using Convex Ents encouraged/recommended?

I just found Convex Ents and I’m wondering if it’s encouraged to use it over vanilla convex or not? Is it kept up to date nicely? Is it problematic for any reason? Ents seems pretty great...

Paginated Query With Empty String Argument Gives Unexpected Results

I have a paginated query implemented something like this ```ts const getDataByClerkId = query({ args: {...

File Storage Read Permissions - Currently World-readable!

I am trying to serve files in storage via getUrl, but I've discovered that those files are world readable, outside convex, on the open internet (e.g. via curl - try it on your side). How can I control read access to these functions? Can I set permissions when writing, and if so how?...

Unable to get Tanstack Trellaux Start working

So brand new here... to start i'm trying to get this demo repo and running and getting this error. THe project did successfully get created on Convex and there's a .env.local file created with CONVEX_DEPLOYMENT and CONVEX_URL so not sure why the error is saying missing envar CONVEX_URL...
No description

Is nextjs recommended with convex? or not ideal?

I’m trying to decide what react framework I should use when building on convex. I’m fairly new to the react world but I’ve built apps with many types of tech stacks over the years. I know convex works with any react framework. Though it seems like it overlaps with some nextjs functionality and maybe I would be better off using vite + tanstack pieces, etc. I’m building a single page app and don’t need SSR but it seems like nextjs is still popular for most use cases. This is a real b2b SaaS app I’m building so I want a solid framework foundation for a bigger/complex product....

Recommended pattern for initializing useQuery with server loaded value

Hey folks, Is there a recommended NextJS-compatible pattern for initializing a useQuery hook with a result from the server so that initial page load is very snappy but subsequent changes are fully reactive? (I realize this involves double fetching) e.g....

Convex auth

Hey guys, I wanted to switch to convex auth and I have a type issue for the OPT: Object literal may only specify known properties, and 'id' does not exist in type 'EmailUserConfig<GenericDataModel> & Pick<EmailConfig<GenericDataModel>, "sendVerificationRequest">' from the file ResendOTP.ts:...

deploy turbo project - nextjs, react native, convex on vercel

how to deploy this repo to vercel ? https://github.com/get-convex/turbo-expo-nextjs-clerk-convex-monorepo eg. how to structure builld command ? currently I have this in turbo.json...

Clerk With Convex in Backend Functions

I want to store a score variable in the public metadata but I can't figure out how to modify that from the backend and I get an error? Error: ``` Uncaught Error...

Using HTTP "Host" header to help validate requests

I'm building some HTTP endpoints for internal use and want to validate requests through them using a token. However, I want to use a different token for prod and dev Convex environments. In looking for a way to identify programmatically which environment is running the function, I noticed that the request's "Host" header matches the root HTTP endpoint URL; e.g. "perfect-ant-202.convex.site". Is it safe to compare against that to determine if the dev or prod URL was called? Is there a chance that...

Don't see db results after mutation, but only after the action is done running.

I'm updating file a couple rows at a time. But even though I see a console log before mutation (which changes data) for every batch, i see results on frontend only after all batches and so the action has finished running.

BUG: Convex Auth Instagram Login - pkce cookie is missing

I'm getting this msg after trying to authorize the callback webhook on https://developers.facebook.com/ I have set the instagram app and env (on convex) as said in the convex auth (and auth.js) docs. here is the error:...
No description

Help Needed: EAS Build Failing for iOS in Monorepo Setup (Module Resolution Issue)

Hi everyone, I’m running into an issue with my Expo project during an iOS build using EAS, and I’m hoping someone can help me figure out what’s going wrong. The Issue:...