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

File serving in a nextjs app via http action authenticated with clerk

After looking at the docs, this is the implementation I came with for serving my files securely via http action. Any feedback appreciated. /convex/http.ts ```typescript import { HonoWithConvex, HttpRouterWithHono } from "convex-helpers/server/hono";...

Re execute query with React when parameter change

Hi everyone, I use useQuery with react to execute my query but one query's parameter depends from a select tag, How can I reexecute my query when the selected value change. I'm pretty sure I saw something to do that on discord or stack.convex, I didn't retrieve it. Thank for your help...

How to query an array in filter or withIndex

I want to query an array of users by either filter or withindex, any assistance will be great. Example of schema - chat: defineTable({ isGroupChat: v.boolean(),...

npx convex dev Doesn´t do anything after setup

Hello there! Just aquickone. When I run the npx convex dev in the terminal it does it's thing for just 1 second and turns red. I don´t even know if it did anything at all.. but My app is not running and I get the other error in when I run the app locally. "Unhandled runtime error" ...
No description

Connection to database never establishes

Hi, I'm having issues connecting to my convex backend. It seems the websocket connection never succeeds. This was working fine yesterday. Can anyone tell what's happening? I've attached screenshots of the console. I'm following the otp auth flow with resend from the docs. I can add additional context if needed. Any assistance is much appreciated. Thanks!...
No description

Convex Auth with nuxt/js

Does anyone have any experience or knowledge how to install convex with database auth in nuxt.js? I have read through the docs and tried to come up with something myself but no succes so far.

auth/core and convex-dev/auth seem to have diverged in typing

I used to run convex-auth demo fine on "@auth/core": "^0.34.1", "@convex-dev/auth": "^0.0.61", Now I've tried again and under "@auth/core": "^0.37.0",...
No description

User Profile creation on signup

Hi, Currently when I signup, I am taking a bunch of information from the user, and some of the data is for user profile, and when i signup, i want to create user profile with the data and connect it to the user with id, is that possible?

React Native Quickstart Error

I'm following the docs to set up react-native with convex but running into this error: ``` ✘ [ERROR] Could not resolve "convex/server" ...

How to use Buffer in httpRouter?

Some npm packages I need rely on Buffer and I am already using "use node" for convexAuth ConvexCredentials that is working fine. But then I get the following error: ``` InvalidModules: Hit an error while pushing: Loading the pushed modules encountered the following...

TeamNotFound

I recently updated the team and project name in convex and now when I try to deploy, it's telling me the old slug name is not found. How can I get it to know that the team/slug was changed? Error fetching POST https://provision.convex.dev/api/deployment/authorize_preview 404 Not Found: TeamNotFound: No team found with slug: old-team-name: https://provision.convex.dev/api/deployment/authorize_preview...

What’s the best way to connect Convex DB to external services?

Hey everyone, new fan here! 🍻 I’m trying to dive into Convex and figure out how to integrate it with our current workflow. Using Convex on the client side is pretty straightforward, but I’m struggling to understand how to connect to the database from external services, like a task engine running on Cloudflare Workers. Do we need to expose our queries or mutations using httpAction and build another layer for type safety?...

Convex + Nextjs using preloadQuery inside layout.tsx

Hi, I am trying to understand if doing a preloadQuery inside a layout.tsx and share it amongst my "use client" pages through a "react context" has any advantages over using useQuery on each page (assuming the data hasn't changed). Or if it's an anti-pattern cause layout.tsx is loaded once and will not cause re-renders?...

Tracking time of an API call

I'd like to track the execution time of an API call made in an action, and save the duration into a field. This call could take anywhere from a couple seconds to well over a minute. I'm already creating a record at the start of the action right before calling the API, so my first thought was to just get a new Date instance (or using Date.now()), and then compare the value against the record's creation time. However, then I read this about dates in Convex functions: https://docs.convex.dev/functions/runtimes#using-randomness-and-time-in-queries-and-mutations Is there another way to pull this off and accurately track when I receive the response from the API call?...

How to query data without authentication

Hello guys, I want to get data from some tables without authentication. Can i do that and if possible, how? Thanks!

Buffer not defined

Hi guys, I'm developing a mobile app with a Convex backend and have written functions using the bitcoinjs-lib library. When pushing these functions, I encounter a 'Buffer undefined' error. I've tried adding import ``` { Buffer } from "buffer"; ...
No description

Latest version of @convex-dev/auth is with some type errors using Resend as a magic link provider

I can't use react-email either; it seems like the react config parameter to load a react template isn't working.

Supposed to return ids in random order but mostly does one image

I'm trying to pull down 5 document entries in my "levels" table and it seems to only ever return the ids in the same order most of the time. Every once and a while and sometimes when I have to refresh the npx convex dev server, will it then pull a different image. Is my code wrong? ```tsx import { v } from "convex/values"; ...

API Functions Returning from Server but showing undefined in client

I'm having an issue now where my backend and my front end are not syncing with my api functions. The client is saying the ids are undefined even tho the server is saying they are being returned. Code: https://gist.github.com/DylanDevelops/c200090842b559c1837591662b1c8154...
No description

How to find a table entry from _id

I want to query the my table and find the table document that has the _id i pass in. How do I do this?