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

self-hosted

announcements

Narrowing function return type

Hi, consider the toy example below: passing true as an argument causes the function to return a number while passing false causes it to return a boolean. The inferred return type is however always number | boolean regardless of what argument is passed. I guess this is just a quirk with TS not narrowing function signature based on arguments passed. Is it possible to achieve this however in an elegant way? 🙂 ```...

Generate same OTP code for demo account for app store reviewing purposes? (Convex Auth)

Can I make a certain account such as demo@gmail.com to have a same OTP code each time, so that reviewers on the app store reviewing our app can use the same OTP credentials?

Monorepo

I want to build an app and use Convex for both the mobile and web versions. I’m new to using monorepos and came across a monorepo template—does it work with the latest updates? Can I use it as is, or will it require significant updates?

Data center locations

I'm interested in using convex for an upcoming project, I am just curious: 1. Are there servers in my country (South Africa)? - If not, where is the closest data center? 2. Do I need to specify which data center to use? Or does convex do that automatically?...

two reactclient

I used convex-helpers ts-api-spec to export the api and found that there were only function definitions but no model schemas. How can I obtain the model schemas?

I want to put CODEOWNERS files in my /convex - but how?

Splitting the /convex folder into domains will be handy as the team is growing. Alread we have something like: /convex |--foobar |-- schema.ts ...

Convex Stuck Running 'npx convex dev'

When attempting to deploy to dev i encouter a timeout have tested connection and this is fine. See logs below, I get stuck at the deployment step: ``` ✔ Schema validation complete. Downloading current deployment state......

Type instantiation is excessively deep and possibly infinite.

I’m encountering the following TypeScript error in my project: Type instantiation is excessively deep and possibly infinite I’m new to TypeScript and don’t have much experience with its type system. My project has a complex directory structure with multiple levels of nesting, and I suspect the deeply nested structure might be causing the issue. ...

Filtering a many:many ENT Edge

Hey all, having some issues with filtering an edge with ents. I am on convex-ents@latest, Typescript 5.7 and convex 1.13.2. here is my query: ``` export const getEventsByTeamId = query({...

how to query all rows (recursively) ?

i need to pull all the between two dates but i need to query an estimate of 1mil++ rows. I know convex doesnt like big queries, so im guessing i need to run in recursively untill it is exhausted.

Why i load image so slow from file storage?

file size is just 661.24KB Please help me...

Set environment variables in an action

I wanted to ask if it’s possible to modify environment variables from actions or cron jobs in Convex? If this is not currently supported, are there alternative approaches to dynamically update and store configuration values at runtime, such as using a dedicated key-value store or similar mechanisms? Looking forward to your response. Thanks in advance and best regards,...

Validate Id<"tableName"> or Doc<"tableName"> on the client or server?

How can we validate the type of Id or Doc in the client with typescript? I've tried instanceOf, and casting the type but it gives me an error that the type passed is of type any, The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.ts(2358) ```ts...

Issue with uploadstuff Package Breaking Builds on Convex and Vercel

Hello, I'm running into an issue with the uploadstuff package that's causing apps using it with Convex to break, especially after upgrading to React 19 with the compiler. This is also blocking my project from building and deploying on Vercel. I've already submitted a pull request with a fix, but I was wondering if there's any chance for the package to be updated soon to resolve this issue....

Suboptimal Caching Behavior for Public Queries

Current Behavior - Query results are only cached per user session - Cache is not shared between different users or sessions - Even public queries with stable parameters require fresh DB hits for each new user/session - Example: Product listing queries with same filters/pagination hit DB for each new visitor...

isAuthenticated sometimes not true

@Starlord says
i cant catch bug why sometimes after successful convex-dev react signin method auth.isAuthenticated is not set to true. it happens randomly like in 1/50 cases. But it for sure plugin problem everything is implemented correctly on client side...

Convex in Release Build (React Native)

I am moving from a local build (in an iOS simulator) to a release build (on my iPhone) of my app. I am using Convex as my backend. I am noticing that none of the database or API functions are firing as expected. Are there additional setup steps required? Do I need to follow the production deployment steps for this testing phase? Thanks!...

Using AuthJS, how to get current user in route.ts in NextJS.

``` export const getSession = query({ args: {}, handler: async (ctx) => { const sessionId = await getAuthSessionId(ctx);...