oscklm
CCConvex Community
•Created by oscklm on 12/5/2024 in #support-community
Convex-helpers zod.ts typescript error caught by npx tsc
1 replies
CCConvex Community
•Created by oscklm on 11/22/2024 in #support-community
Issue with convex being picked up by `npx tsc` in expo project
Hello, was hoping some typescript wizard could help me out here. I've been trying to configure my repos tsconfig to not clash with the tsconfig.json in our convex/ folder.
The problem
Whenever i run
npx tsc
to check for any typescript compile errors from the root of my repo, it picks up on some files in my projects from the convex/
and says there are errors.
But convex/ has its own tsconfig (the default one from convex), and when running npx tsc
if i cd into the convex folder, i get none of those errors as stated above. So only running tsc in the root says errors are present in a few convex folder files.
I'm using this tsconfig, since im in a expo project:
I've tried a few things:
- Removed the "**/*.tsx", "**/*.ts"
from the include, as i thought maybe those were overwriting the exclude i added, but that messed all my path imports up in my project.
- Playing around with multiple different glob patterns for the excludes, but without luck
- Tried setting up a reference in the root tsconfig to the one in convex/ but that didn't work out due to "noEmit": true
in the convex tsconfig21 replies
CCConvex Community
•Created by oscklm on 9/22/2024 in #support-community
Designing a friend system with Convex
Hi, I’m building a friend system with
Convex
and am torn between two approaches:
1. Multiple indexes for better scalability.
2. Multiple entries in a single table for each friendship.
I’ve implemented lexicographical sorting for user1 and user2 when inserting friendships, but when querying friendships for a user, the following approach is limited by the compound index:
The problem is that compound indexes require the query order to match the order in which the fields were indexed (e.g., ['user1', 'user2'])
, which limits flexibility in querying.
I’ve come up with a solution where id just do multiple entries, 1 for each side of the friendship, but I’m concerned about scalability. Is there a better way to handle this without creating multiple entries for each friendship or excessive indexes?
I'm very curious how to tackle this, specifically if there is any way that goes great with Convex?4 replies
CCConvex Community
•Created by oscklm on 9/17/2024 in #support-community
using _storageId vs storing storage urls directly
How stable are the generated file storage URL´s, and could we rather than storing the _storage id field, just store the file storage URL from the start, like when a document is created and the file uploaded?
Asking this because, im wondering if we could simplify a bunch of enrichments we are doing when querying documents, and their related data?
24 replies
CCConvex Community
•Created by oscklm on 9/13/2024 in #support-community
Require cycle issues, can't seem to troubleshoot to where its coming from
Hello,
I'm getting this error when starting my expo web server. And have tried troubleshooting it for a while now, but can't seem to find any place where this import cycle happens that has anything to do with the files mentioned in the error:
Can anyone from the convex team, help me shine some light on this and where i could maybe look and check?
3 replies
CCConvex Community
•Created by oscklm on 9/10/2024 in #support-community
Issue with expo app and convex, and how .env variables are loaded
Is there a way to have convex read
.env.development
rather than the default .env.local
The reason for asking is that i am using convex in a expo app where i store some production variables in a .env.production
which i use for testing the app against my prod convex deployment.
When i run
yarn dev --no-dev --minify
expo dev server loads the envs from .env.local
and .env.production
but that seems to end up with the production envs being overwritten by the ones in the .local
So i therefore can't seem to test my convex prod env against my expo app, without manually replacing the .env.local variables.
Any recommendations on what to do here for a better dev experience?1 replies
CCConvex Community
•Created by oscklm on 9/10/2024 in #support-community
[ConvexAuth] stuck on auth loading & websocket reconnect
Hello,
We are experiencing some issues with the
@convex-dev/auth
library it seems
We are using these versions of the related packages:
@convex-dev/auth@0.0.65
convex@1.15.0
When we sign in or sign up a user, the
useConvexAuth() doesnt pickup the change it seems, and we are stuck with a isLoading being
true and get the WebSocket reconnect logged in console below, until we use signOut() from
useAuthActions()`
We've made a repro available here, which isolates the issue:
https://github.com/oscklm/flimmer-auth-issue
We've troubleshooted and tried a bunch of different approaches:
- yarn clean cache, remove node_modules, delete yarn lock
- we tried setting up a repro, and removing pretty much everything but auth9 replies
CCConvex Community
•Created by oscklm on 9/5/2024 in #support-community
Verifying JWS Signed Payload in Convex httpAction
I am currently working on verifying an Apple App Store notification's signed payload using a public key within a Convex httpAction. Below is a snippet of the code I am using:
I am unable to use the
jsonwebtoken
library directly in the code to verify the JWS signed payload.
Could you please provide a different recommended approach for verifying JWS signed payloads in this httpAction context?
Thanks!2 replies
CCConvex Community
•Created by oscklm on 8/26/2024 in #support-community
[ConvexAuth]: Handling errors that happen from the useAuthActions methods
2 replies
CCConvex Community
•Created by oscklm on 8/8/2024 in #support-community
[ConvexAuth] Convex 1.14 seems to break ConvexAuthProvider token storage
Just had a issue where tokens weren't picked up by ConvexAuthProvider, after upgrading to Convex 1.14, going back to 1.13.2 fixed the issue, and saved jwt tokens were loaded as expected.
Let me know if more info is needed
9 replies
CCConvex Community
•Created by oscklm on 8/6/2024 in #support-community
[ConvexAuth]: ERROR Auth token is not a valid JWT, cannot refetch the token
Hey,
I'm using ConvexAuth in app, and specifically, using the password-code from the convex auth demo repo, i'm able to successfully sign up and verify with my email code.
And also able to login when using the
password-code
provider and flow signIn
But upon being signed in, i get the following error:
ERROR Auth token is not a valid JWT, cannot refetch the token
convex/auth.ts
SignInScreen.tsx
4 replies
CCConvex Community
•Created by oscklm on 8/6/2024 in #support-community
[ConvexAuth]: additional fields passed to signIn, added to user document?
Hello,
Is there a way to pass additional sign up values passed to
signIn
from useAuthActions
like for example, here when i sign up my user, i let them define a name in my signup component.
I'm unsure where to get the name from, since its not passed to args.profile etc?
16 replies
CCConvex Community
•Created by oscklm on 7/30/2024 in #support-community
Issue with asyncMap in convex-helpers and Next.js 14.2.5
I'm getting this issue when trying to build my next.js app within my monorepo. I'm using the convex-helpers in my backend package.
I'm not sure what i can do, my target is set to ESNext for both next.js and my backend package.
20 replies
CCConvex Community
•Created by oscklm on 7/19/2024 in #support-community
[ConvexAuth] getting jwtToken to pass to auth headers in fetch on client
Is there a way to get the jwtToken client side when authenticated, when using convex auth? i'd like to pass it in the auth headers of a fetch request from my client
Like for example with clerk you could do something like:
19 replies
CCConvex Community
•Created by oscklm on 7/18/2024 in #support-community
[ConvexAuth] settings values of custom users fields, on user creation
Hey, i've been looking through the docs. And would imagine settings some values for the fields i have customized on the schema for users, when the users get created. Would be done in the account callback configuration?
But looking at the API, i've failed to figure out how to use this callback:
I wanna achieve setting some of the custom fields i define when i create a user
6 replies
CCConvex Community
•Created by oscklm on 7/16/2024 in #support-community
Working with return validator and a query that enriches data
Hello,
In our project, we use relational tables and in a query like the one below, where we wanna enrich video with its related data. We wanna use this new return validation, but find it a bit hard to get the returned object to actually match the validator we define.
I'd love to ask for some advice on how to best approach this, as we are looking to do it quite a lot with other pieces of data in our app.
Return validator:
10 replies
CCConvex Community
•Created by oscklm on 7/13/2024 in #support-community
Return value validation question?
If i wanna use the return value validation in a function. And say that function returns an array of documents.
How may i define the return value, as the doc. I have a
myValidator
exported from a validators.ts
file that i can use like returns: v.array(videoValidator)
But that ends up erroring, since what im returning is the result of a .collect()
so basically what ends up coming through is system fields aswell.
I don't see anything regarding validating returned objects containing system fields in the docs.17 replies
CCConvex Community
•Created by oscklm on 6/27/2024 in #support-community
Convex.json external packages not installing, pnpm monorepo
So there seems to be a lack of externalPackages to support a monorepo, like ours which uses
node-linker=hoisted
in a .npmrc
The node-linker hoisted flattens and causes all modules to be installed in the root node_modules folder.
So when we define externalPackages, in our convex.json
like this:
The external packages doesn't get installed when running convex dev
Comparing to a non monorepo project, this works without problems.
A bit of a forced workaround, that solves the issue:
Manually moving a "sharp" module from the root node_modules, into the packages/backend/node_modules, will solve this issue. But seems like a bit of a forceful workaround. Even though it does work.5 replies
CCConvex Community
•Created by oscklm on 6/24/2024 in #support-community
Issues when installing sharp in action with pnpm
Hey, trying to install sharp for my action. My monorepo is setup usng
pnpm
as packagemanager.
Having trouble trying to install the correct prebuilt binary, so that it can run in the convex javascript runtime?
18 replies
CCConvex Community
•Created by oscklm on 6/14/2024 in #support-community
Multiple actions in one file, using different node modules?
Hey,
So i currently have a actions.ts holding my actions. In that i have multiple actions, and import some different modules at the top.
When i need to create a client like above, should i create these clients in the top of actions.ts or inside of the invidual actions?
I would think that creating them inside the action, unless they are shared makes sense.
Are there any docs or something that can better help outline the "life cycle" of an action and how it works when having multiple in one file. I'm very curious to better understand how this actually get "compiled" into runnable code?
3 replies