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

Convex Node runtime vs Node

Hi! I have a code that works outside of Convex runtime. It is short and simple so I put here for reference. When this runs on Convex, I get "Connection lost while action was in flight" and the logs show "Your request couldn't be completed. Try again later." The latter seems like a response from one of the external services I'm using. However, running the same code, with the same API keys, outside of Convex works perfectly fine. Has anyone came by something like this before? ```ts "use node"; ...

App Remounts on Navigation with Tanstack Router + Convex Auth

I verified both Convex Auth and (Clerk + Convex) providers. For both solutions, it seems that the app unmounts for some reason between navigations until the auth state is determined. So even when I am authenticated and navigate between protected routes, the issue remains, and the isAuthenticated state is reset on page navigation. _authed.tsx: ```tsx import { createFileRoute, Navigate, Outlet } from '@tanstack/react-router'; import { Authenticated, Unauthenticated } from 'convex/react';...

Not finding Function? But i can see it in the dashboard...

Air-Alert-Starter $ npx convex run getMaskRecommendation '{"latitude": 37.7749, "longitude": -122.4194}' āœ– Failed to run function "getMaskRecommendation": Error: [Request ID: 2bf512aecab915c6] Server Error Could not find function for 'getMaskRecommendation'. Did you forget to run npx convex dev or npx convex deploy? ...
No description

Using Sentry integration with Datadog

I would love to use the sentry integration with Datadog (I understand that there is a Datadog log integration, but I think setting up Error tracking is actually easier using the Sentry SDK. I'm not an expert, so I don't know whether this would actually make sense in productionTM. Anyway...) Datadog supports the Sentry SDK, but you need to provide a service name, like this: ```Sentry.init({ dsn: "<DSN>", initialScope: { tags: {...

Table Aggregrate Component Question

``` likes: defineTable({ userId: v.id('users'), parentId: v.union( v.id('posts'),...

having problem authenticating when running the project in github codespaces

I am using convexAuth when i am running the project in github codespaces and try to auhtenticate or create a account in my project i am seeing this error sign-up-card.tsx:47 POST https://musical-doodle-g455gvjr7wv73994v-3000.app.github.dev/api/auth 403 (Forbidden) sign-up-card.tsx:50 SyntaxError: Unexpected token 'I', "Invalid origin" is not valid JSON...

Env variables being pushed automatically

Is something like this possible: when running npx convex dev , variables in the following files inside the convex folder get pushed to the following deployments: env.local -> development env.staging -> preview...

multiple convex deployments (nextjs and expo) - do they overwrite?

Hey just a quick question, if running npx convex deploy from one repo (nextjs) which doesnt have all the schema and function files from the other repo (expo), doest this overwrite them in the convex dashboard or potentially delete them? Just being safe.

Convex Auth session keeps dying

Hi, My app session keeps dying out of nowhere. It happens ~daily (interestingly, usually happens at the same time as on the Convex Dashboard). Most of the times I open the browser (Arc) and both my app and Convex Dashboard are logged out, so I re-sign-in on both. Sometimes it happens while I'm using it (did just now)....
No description

Convex Self-host

I built an MVP for the company I work for on convex. I plan on using it in the actual product but we have to self-host in our own servers to be compliant with company policy. If i deploy convex in my company's servers myself, do i get a dashboard similar to the one in convex.dev?

Error after updateing auth running npx convex dev

get this error trying to deploy dev changes ```āœ˜ [ERROR] No matching export in "../../node_modules/@auth/core/index.js" for import "customFetch" node_modules/@convex-dev/auth/dist/server/oauth/lib/utils/customFetch.js:3:9:...

Lets say there are a lot of apps...

Lets assume that there are 5 apps with their individual databases on Convex. Now lets say later in the future I realize that I want to suggested recommendations on one app based on the data in other apps - would that be possible with convex? (5 apps would have 5 databases as I think it would be scalable for each of those individual services/apps). Also is it possible to share auth data amongst all 5 apps?

Keeping the user logged in forever.

I am developing a mobile application using Convex for authentication management. The app is built using two approaches: a Capacitor Next.js app and a React Native app (for testing both frameworks). How can I maintain the user authentication session across both platforms so that users only need to log in once? Could you provide guidance on implementing a persistent auth session in this setup?...

Can I setup an index with array list field

In my users table, I'm adding a new key roles which is an array. Is it possible to declare an index based on that field? If yes, how could I run a query using the .withIndex api where the values of the field are in a list? If this is not possible, is there a pattern or workaround I could choose to "limit" queries upon the (very large) users table, based on roles?

Circular dependencies in validators

I'm defining my tables using Table from convex helpers, and I want to define some enriched versions of these documents using a Convex validator in the same schema.ts file such that I can pass it around to other validators and Convex functions. I'm running into circular dependency issues, however. See the attached screenshot for the specific example. I can seemingly fix this by putting enrichment validators into a enrich.ts file in each table folder, but is this really the only way? I would love to have both table validator and enriched validators and types in the same schema.ts file....
No description

while using pagination, I'm failing to sort the elements in the right order of creation

while using the pagination function with a bunch of messgaes, I'm giving them order("desc") so we can get the last numItems that have been added to the array, when I do so, after the second load, the element are re-ordered bottom up, how can I fix this in the best way possible with convex? I tried sorting with .sort((a,b)=>a._creationTime -b.creationTime) but that resorts them on the second load,...

How to reduce bandwidth reads?

Bandwidth reads are out of place for the size of the project, how can I identify what is the cause?
No description

convex auth session across subdomains

Is there a way to make a convex auth session valid across subdomains of a same domain like it is for clerk by default?