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

Not able to connect to Convex

I have been working on a site that uses Convex for about a week. Today, I ran into issues with connecting to Convex When I try to open my project in the dashboard, I see the convex loading spinner. ...

Issues deploying to Fly.io

I'm trying to deploy to Fly.io, but I keep hitting this error:
> [build 5/6] RUN npx convex deploy --cmd 'npm run build':
0.772 ✖ Error: You are not logged in. Log in with `npx convex dev` or set the CONVEX_DEPLOY_KEY environment variable.
> [build 5/6] RUN npx convex deploy --cmd 'npm run build':
0.772 ✖ Error: You are not logged in. Log in with `npx convex dev` or set the CONVEX_DEPLOY_KEY environment variable.
...

Union from data?

I'm migrating a detailed planning system from Airtable to Convex, and one of the data points on each task is the task type. In the original Airtable version, each type is assigned a color. When saving the data, though, I only want to save the name of the task type, with the color only being rendered inside the app for visual reference. Originally I had designed the table schema with the possible options for the task type like this: ```js taskType: v.union(...

Convex Auth: react-native expo OTP throws Uncaught Error: Could not verify code

I'm using the new convex auth in my react-native expo. I'm trying to implement authentication with OTP. After having followed the documentation here https://labs.convex.dev/auth/config/otps, I, then, follow the demo project here https://github.com/get-convex/convex-auth-example/blob/main/src/auth/SignInFormPhoneCode.tsx ...

npx convex import - always pushes to the same/wrong project

👋 Trying to get some test data into a table and for whatever reason, whenever I run npx convex import ... , the data always gets written to the wrong project in my account. - I only have 2 projects in my account. Projects A & B. I would like to import data into project B. If it matters, project A was created first. ...

Is there a way to control the websocket reconnect backoff?

Basically I want to cap the reconnect time to 10seconds. I was just doing some local testing and very quickly went over 20 seconds:
Attempting reconnect in 22248.468971814553ms
Attempting reconnect in 22248.468971814553ms
Any help greatly appreciated....

a little confused about getManyVia

Hey all, I have a table features which stores different feature options and joiner table property_features which connects the features to properties and has an additional details field for property specific information per feature. I'm trying to get all the property features (name, as well as the details), so I thought that getManyVia would be the best option to use, but I'm only getting the names but not the details. Have I misunderstood how this works? extract from schema...

Help with loading images from image id in a table and image sitting in the Files

I'm making a next.js/react app using typescript. I have a query to get every level: ```ts import { v } from "convex/values";...
No description

Stuck at "Parsing uploaded data"

I'm trying to import a small .jsonl file like the docs say, however I get stuck at "Parsing uploaded data" forever. The data is ok and it should pass schema validation. I originally tried with a .csv but no luck so I switched to jsonl but the result is the same. I'm using mac with vscode and I've been able to import the data before, but no luck now whatsoever. Any help? Thanks!...
No description

Accessing deployment metadata via cli

Is it possible to get the deploy urls via cli?

How can i check if I'm on production or on development?

I think you need to define variables in convex variables and you cannot use ones from .env file. But how can i define them in convex so that I get development when i run this on localhost and production when it's a deployed version?

usePreloadQuery - undefined is not an Object (evaluating 'preloadQuery._argsJSON')

I'm trying to server-render using Remix via preloadQuery. From the log, I can see NEXT_PUBLIC_CONVEX_URL and CONVEX_URL have values, but i'm getting this error. I'm deploying to fly.io...
No description

Server show signed in & refreshed token, yet, <Unauthenticated> is triggered

What am I missing here? I'm just trying to use Email/Password Signup & Register. Nothing else. Not using OAuth. Been working fine for months with Clerk. I am trying to migrate to Convex Auth. The project is huge so i did screen shots and compressed the user functions (partial) and user schema into a single TS file. The server is configured, tables, env, keys. It looks like its working but there is some disconnected with the Provider/Context?...
No description

Schedule function

hello there I need to execute a specific task every minute on creation (api.some_task.create), but only for a duration of 10 minutes. Could someone please guide me on how to schedule this function?...

Did you mean 'typeof ConvexProvider'?

Example straight outta of next.js quickstart has the ConvexProvider component throwing this TS error. "'ConvexProvider' refers to a value, but is being used as a type here. Did you mean 'typeof ConvexProvider'?ts(2749)" `"use client"; ...

Recommended way to mock functions of actions, and the "2 dot hack"

Hi! I Couldn't find a recipe or example of how to mock convex actions, for cases where an action depends on external services. Initially, I tried to mock actions directly, but realized that it might be an anti-pattern since the responsibility of an action (from what I understand), is to combine the DB with external services (called via fetch or external function), and we should only mock the external part. So I tried to mock functions with the vitest setup, but the files containing mocks are considered for production deployment (__mocks__/mock-name.js is not a valid path to a Convex module)....

immutable schema field

I guess the only way to do this atm is with a db writer wrapper? Would be a pretty useful helper imo! By marking a field as immutable, once it’s value is set it cannot be changed just to be clear...

Feature request: Account switching in CLI

Earlier this morning I found a thread where @lee was helping someone with a login-switching problem, and I'm glad I did. I've got both personal and work accounts on Convex, and it looks like I'll be using the solution that Lee shared (forcing the login: npx convex login --force) a lot as I'll be switching between these accounts very frequently on the same system, possibly multiple times a day. Would it be possible to update the CLI tool to a) allow more than one authorized login on the same system, and b) add a login switching feature? Maybe something like npx convex login --switch to bring up a prompt showing all available options, or npx convex login --use [nickname] to immediately change. I feel this could be a really useful feature for many users....

Getting Url for a file in convex

When I try to send a request, it writes an error 404 Not found, I tried to find the answer in the documentation and the problem is that the file id that we have does not work to receive the link ``ts function getFileUrl(fileId: Id<"_storage">): string{ return ${process.env.NEXT_PUBLIC_CONVEX_URL}/getImage?storageId=${fileId}`...
No description