nextjs handling server-side errors in error page
I'm using Nextjs, and I've setup a catch all error page to handle all errors, I've set it up to show formatted convex Errors if it's
instanceof ConvexError
see code below:
```typescript
"use client";
import ......nullThrows has wrong type or jsdoc
```ts
/**
* Filters out null elements from an array.
* @param list List of elements that might be null.
* @returns List of elements with nulls removed....
React Testing Library + Vitest + Convex Test?
Can
convex-test
be used with Vitest and React Testing Library during unit tests for components?
Docs for convex-test
point to examples of testing queries and mutations directly (from within the backend convex directory). Can it also be used to mock component tests which indirectly trigger Convex queries and mutations? Are there best practice examples of this I can see?...Convex migrations in self-hosted
Hi, I am evaluating convex for an app that currently uses yjs / livekit but got too complex.
for the saas I can use convex hosted, but many business clients want full on premise solution so I need to self host. I see in the docs you don't support migrations, but is there any migration guide or info and are people doing it in practice?
I also can't afford an enterprise plan with on premise support as I'm just getting started and they are SMBs, but I also can't adopt convex without self hosting for them on their servers, but they won't need a lot of scaling..
I will not be self-hosting the saas version.
...
mutation retries
I have a action inside a mutation. As we known the mutations will retry themselves when failed, will the acitons inside also be retried?
Conditionally Building Queries
Having trouble figuring out how to do the following without TypeScript complaining.
I want to start a query like this:
```...
Exponential number of indexes required?
I'm trying to build a component that shows data according to multiple filters which can be set or unset.
Can I just define one index with all these fields in there and ignore set equality filters to
undefined
values for the filters that are not set? If not, how should I construct my indices?
The list I'm filtering over is potentially very long....Is that possible to convert a type to validator?
Hi, to better maintain types in project, I wonder if there is a way to convert types to validators?
Index on optional nested properties
Is there a reason that on the schema:
```
export const vGameState = v.object({
playerOne: v.optional(
v.object({ userId: v.id("users"), username: v.string() })...
Bandwidth usage multiplied by piping arguments?
Hellooo!
I noticed that one of my daily cron jobs is incurring rater high bandwidth usage. We have a video streaming app, and this cron job collects all watch events within the past 24 hours (using the _creationTime index) and populates three aggregates with these documents.
My specific question is this: Let's say I query 1 MB worth of data and call four functions with this as an argument:...
how to get client timezone
my app is sending email action (convex action + react email), I've rendered a date time using
date.now()
on the email body and when the email is sent to the client, they got the server date time, how do i compensate this ? I'm guessing that I'll need to get the request's time zone, but how ?useQuery different return types
Hello, I'm fetching data with useQuery and for some reason it has two different return types. In one component it returns an object with the data, error, etc properties while in the other it only returns the data.
returns entry type | null | undefined
```ts
const entry = useQuery(api.functions.anime_entries.authSingleById, {...
How to preload data with Remix?
I understand in nextjs you can preload data with preloadQuery, but in remix it terminate the server, I also need to send the logged in user to convex, im using convex auth.
Error: Environment variable NEXT_PUBLIC_CONVEX_URL is not set.
I tried to add this env variable, but didnt work, in the past it did.
...
Convex + Tanstack Start + Clerk
Hi! I'm trying to add authentication using Clerk to the Trellaux example from the Tanstack-Start site (https://tanstack.com/router/latest/docs/framework/react/examples/start-convex-trellaux). However, the guides from the Convex/Clerk site do not work.
ConvexProviderWithClerk
seems not supported on Start, so in Convex functions I am not able to get the user identity with ctx.auth.getUserIdentity()
.
Is there any way to make it work? Thanks...[Convex Ents](bug): One to many edge with weird type
my schema looks like that
```ts
const schema = defineEntSchema({
// other ents
...
/authenticate route to get the Bearer Token of the user given their username and pass using Clerk
How can I fix this httpAction to use Clerk to get the Bearer token of the user based on the username and password that the user will provide in the request body of the api call to convex:
```
import { httpAction } from "../_generated/server";
import { Clerk } from "@clerk/clerk-js";
...
[Solved] Error: 1013
hey everyone, I was starting my dev app as usual and I noticed that my avatar wasn't appearing, I check console, and I found it constantly repeating ...
WebSocket closed with code 1013: AuthProviderDiscoveryFailed
logging.ts:96 Attempting reconnect in 118.9021804382428ms
logging.ts:96 WebSocket reconnected
WebSocket closed with code 1013: AuthProviderDiscoveryFailed
logging.ts:96 Attempting reconnect in 118.9021804382428ms
logging.ts:96 WebSocket reconnected
Tanstack query with usePaginatedQuery is not working
I'm having trouble using TanStack Query's
usePaginatedQuery
. It doesnβt seem to behave as expected, and TypeScript is throwing errors. Hereβs the code and the error Iβm encountering:
Working Example
This works fine:
...