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

tailwind

was having trouble getting tailwind to work so In just created a brand new project using pnpm create convex@latest selecting vite and github auth ```...

Index query with "OR" statement

hello, is there a way to optimize this query using index because "or" statement is not possible in index? this way full table data is fetched and only filtered afterwards. ``` ...

Combination of .paginate and getPage question

``` const following = await ctx.db .query('follows') .withIndex('uniqueRelationship', (q) => q.eq('followerType', 'user') .eq('followerId', ctx.user._id))...

testing convex

I am just getting the hang of vitest. I read this https://docs.convex.dev/testing/convex-test and it seems like a pretty good guide to testing convex code in a convex project. I am looking for guidance in testing the front end code in a convex project. Not sure how to go about it, how is the backend mocked?...

Catching error when creating a user

I am building an intranet as a fun project on the side. For the login flow, i want to use oauth providers, but only allow for users with email existing in a table in convex. I am able to this in the createOrUpdate callback. However, in the instance where someone is trying to login that i dont want to allow, an error is thrown. The error does however only show in the convex logs. Is there a way I can catch this error so i can show an appropriate message on the client?

Middleware Issue on our Nextjs project

We are facing an issue on our existing middleware setup on our nextjs project, we use to check if a user is authenticated before using this code:
await convexAuth.isAuthenticated()
await convexAuth.isAuthenticated()
but now after upgrading convex auth from 0.0.74 to 0.0.80 we are getting this error: Middleware.ts file code...

Type Issue with gameId in Convex Query

Hi, I have an issue with TypeScript types in Convex. I'm looking at the example code in the Fast5 repo: ``` import { v } from "convex/values";...

Cannot solve "Convex functions should not directly call other Convex functions"

I searched, asked AI and tried to create helper functions but I can't get rid of this warn, it seems to be happening in my Promise.all() because I get a lot of logs. My helper functions: ```ts // convex/models/routes.ts ...

Sharing Convex Authentication State Between Main App and Share Extension in React Native

I'm building a React Native app with Convex and Clerk for authentication. I'm trying to implement a share extension that needs to access the authenticated Convex state from the main app. Current Setup - Main App:...

Error: Unexpected token 'N', "No matchin"... is not valid JSON

```ts http.route({ path: "/resources/", method: "GET", handler: httpAction(async (ctx, request) => {...

Could not load the "sharp" module using the linux-arm64 runtime

Trying to use a library that uses sharp inside a convex action and get this error. Using bun pkg manager. Any thoughts from anyone?

how do i skip indexed query field

it seems like i am forced to follow the order of the defined index in schema. I dont want to use filter because some of the query are hitting too many bytes read error. please help schema.ts ```ts .index("organizationId_postedAt_experiment", [...

PushNotifications component, should I also build out in app notifications?

I have an expo app with push notifications working, for users that decline the notification prompt should I build an in app notifications table or can I still leverage the data tables for notifications in the PushNotifications component?

Type 'Iterable<FromType>' can only be iterated through when using the '--downlevelIteration' flag

Type error: Type 'Iterable<FromType>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher. 14 | let index = 0; 15 | list = await list;
16 | for (const item of list) {...

Error retrieving function spec from your Convex deployment......

I've also raised a GitHub Issue where I've explained the issue in more detail, do have a look on the screenshot as well.
No description

Best solution for checks like unique username

Right now I am building an app with Vite React and zod, react-hook-form. I have a form that does not check uniqueness on the username, but if I add a check, what would be the "best practice"? My Convext backend checks if already exists, I'm just wondering where to add the check on the frontend....

Issue with Google Login in Production

Hi everyone, I’m experiencing an issue with Google login in my production environment. Tech Stack: - Next.js: 15.1 - Convex: 1.17.4...

Can I use "skip" with zQuery?

I'm trying to get a files metadata if a file id exists and "skip" would be perfect for that use case. When inspecting useQuery I can pass skip, but when I try it throws an error because of my zod schema in the query definition. Is there a workaround for this? ``` const fileWithData = useQuery( api.files.getFile, stagedImageId...

Is the bound key required when reading an aggregate count with namespace?

First, I have defined an aggregation like so:
app.use(aggregate, { name: "partners_payments" });
app.use(aggregate, { name: "partners_payments" });
...

Action context inside auth callback

I'm trying to run an action inside of the afterUserCreatedOrUpdated callback, but I'm getting the following error:
Uncaught TypeError: ctx.runAction is not a function
A lot of the documentation talks about runAction, but I could only find examples of using it with useAction on the client. I really want to add details to the users table with 3rd party information after create. ...