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

api.somemodule.somefunction

I have several mature modules (ie, api.user., api.blogs., etc) and i try to break them up into smaller files but it breaks everything unless i rename everything. ``` //const globalPresence = useQuery(api.users.getPresence); // Does not work //const globalPresence = useQuery(api.users.index.getPresence); // Does work const globalPresence = useQuery(api.users.queries.getPresence); // Does work...

More detailed logging on function not found

Since convex doesn’t support versioning, mobile users might get outdated query and mutations names, so if at least we could get auth data or userAgents or something.

paginated query with status

i want to use paginated query with status so it doesn't throw on backend error

offset-based pagination with filtering

How can I implement an offset-based pagination with filter? User would like to fetch paginated data but have a away to limit the data by status. Here is what I've implemented so far. First the 2 tables and the aggregation: ```typescript // tables campaigns: {...

Convex Auth - reset password when logged in

I've set up convex auth with email verification and password reset using Resend. Everything is working great. I can reset the password as intended when a user is NOT logged in. I.e. the user has forgotten the password, they enter their email, they're emailed a code via Resend, they enter it together with a new password and it's updated correctly. However separately, I now have a modal within the app where a user should be able to update their password when they are already logged in. The problem I'm having it that the reset flow seems to delete the session data, logging the user out. I ideally don't want this as this breaks the UI and throws an error as there are queries in the background that rerun and throw an error if there's no logged in user. Is there a way round this? I feel like this is a common situation where a user would like to update their password whilst logged in?...

npx convex dev not working

I recently created a nextjs app with the command npm create convex@latest I ran npx convex dev and the below showed up: Welcome to developing with Convex, let's get you logged in. ? Device name: Nicholas’s MacBook Air...

Search Advice

Hi, I have a table called profiles that has several fields Name (str), Username (str), Email (str), Rank (int), Tags (array(str)), Age (int), Gender (str), etc... I want to be able to do full text search and typeahead while being able to filter and sort on name (a-z, z-a), username (a-z, z-a), rank (low-high, high-low), tags (filter by specific tags), age (range, high-low, low-high), gender (filter by Male, Female, Non-binary, etc...) ...

How do i handle Errors and Loading States using the PreloadQuery in Next.js

Hi everyone, i need help understanding how preloadQuery works in relation to SSR. How do i handle Errors on the server whiles preloading, as well as loading states ?...

Array Contains

const profiles = await ctx.db .query("profiles") .filter((q) => q.contains(q.field("tags"), tag._id)) .order("asc") // Assuming lower rank is better .take(4); // Get top 4 profiles...

Unable to start push / Bad Gateway

Im getting this on my preview deployment. I cant tell if its my problem.. I get Deploying to https://fast-falcon-504.convex.cloud... then ```ts...

Dashboard feature requests ux

Tonight having multiple deployments on vercel linking back to multiple projects on convex was a bit much to sort out. 1. Generated name of convex deployment selected up on top so you don't have to go into settings to figure it out. 2. When a preview deployment is deleted, it should not leave you at a 404 with no way to get back to the dashboard. 3. When you go to enter environment keys a preview deployment should warn you that you should set it in the production env as anything you set here will get overwritten on the next push to vercel. ...

how do i install ssl on my selfhosted docker deploy?

My convex react client wont connect to my selfhosted docker convex backend because i cant use wss because its http

After a query is cached, is calling it again free until its invalidated?

Also how is the cache invalidated, other than changes to the data? Is it on a specific timeframe too ?

file storage on selfhosted? how does this work? do i have to use s3

I am a minor so it inconvenient to access s3. to use file storage do i need to use s3?

Fetching a random subset of documents without having to collect() over the entire set?

Hi team, I'm implementing an app where a core user flow is to be able to answer a subset of questions from a collection of documents I have stored in Convex. Right now, I have it implemented in a way where I fetch ALL of the documents (this can bloat to thousands eventually), and then apply filters related to which questions I'd like to exclude, and then return only a random subset of these documents. This makes my db bandwidth usage skyrocket over time and I'd really like to optimize this. Is there any simpler way to get a random subset of docs from Convex? If not, is there a more efficient way of implementing this in general? I've attached a code snippet below. ```export const getRandomQuestions = query({...

Why no unions as function validators?

The title basically, its a bit annoying to have to wrap stuff in objects

Convex Local Dev Deployments failing

Running Local Dev Deployments with npx convex dev --local --once sets the .env.local to localhost. But Convex cannot connect: ⠴ Fetch failed, is http://127.0.0.1:3210 correct? Retrying... It seems like the local instance isn't running....
No description

Self Hosting

can i used selfhosted convex for a SAAS product?

Multiple deletion issue

i have a table that is hooked with convex triggers & aggregate .component THe error is somewhat related to triggers i think.
No description

Exclude a folder from automatic API generation in Convex?

I would like to exclude a specific folder from automatic API generation. Specifically, I want to have a ./helpers/feature folders to store helper functions that should not be treated as API functions. However, since these helpers are used only by convex, I would like to keep them inside rather than moving them outside convex/. Is there an official way to configure this, like a .convexignore file or some setting in convex.json? It seems like there is a "exclude" array in convex.json but putting my folder path inside the array is not working....