lee
lee
CCConvex Community
Created by Sara on 12/22/2024 in #support-community
Feature Request: return the number the page is on in `.paginate()`
Having "total page number" is actually pretty tricky. You can calculate it with something like https://www.convex.dev/components/sharded-counter or https://www.convex.dev/components/aggregate , but no matter how you calculate it will be fairly heavyweight
4 replies
CCConvex Community
Created by Omar on 12/21/2024 in #support-community
How to get the URL of an image in the storage by its id?
No worries i also missed it
15 replies
CCConvex Community
Created by Omar on 12/21/2024 in #support-community
How to get the URL of an image in the storage by its id?
Instead of {storageId}: {storageId: string} you probably want storageId: string
15 replies
CCConvex Community
Created by Omar on 12/21/2024 in #support-community
How to get the URL of an image in the storage by its id?
Check the argument of getImageUrl
15 replies
CCConvex Community
Created by Omar on 12/21/2024 in #support-community
How to get the URL of an image in the storage by its id?
Ah that makes sense
15 replies
CCConvex Community
Created by Omar on 12/21/2024 in #support-community
How to get the URL of an image in the storage by its id?
Your code looks fine to me, so i'm trying to figure out what might be going wrong
15 replies
CCConvex Community
Created by Omar on 12/21/2024 in #support-community
How to get the URL of an image in the storage by its id?
That is correct. Are you seeing the http action getting called in convex logs?
15 replies
CCConvex Community
Created by Eva on 12/21/2024 in #support-community
`npx convex dev` always adds `.env.local` to `.gitignore`?
Are you on windows? I wonder if the split("\n") isn't accounting for the \r in windows line endings
14 replies
CCConvex Community
Created by Omar on 12/21/2024 in #support-community
How to get the URL of an image in the storage by its id?
what is process.env.NEXT_PUBLIC_CONVEX_SITE_URL ?
15 replies
CCConvex Community
Created by Gamius on 12/19/2024 in #support-community
unique() query returned more than one result
please submit feature request here 🙂 https://github.com/get-convex/convex-ents/issues
17 replies
CCConvex Community
Created by Gamius on 12/19/2024 in #support-community
unique() query returned more than one result
I think it's a reasonable feature request that Ents unique fields drop the uniqueness property (maybe based on a flag?) when it comes to unset/undefined. But as far as I'm aware, that's not an existing feature
17 replies
CCConvex Community
Created by Gamius on 12/19/2024 in #support-community
unique() query returned more than one result
oh you're using Ents
17 replies
CCConvex Community
Created by Gamius on 12/19/2024 in #support-community
unique() query returned more than one result
can you share more code and more about what you're trying to do? in Convex the .unique() method is not a property of the field, it's a property of a query. If you want to query for documents with field=unset, and it's possible there is more than one of those, you can use .collect() or .first()
17 replies
CCConvex Community
Created by djbalin on 12/19/2024 in #support-community
[Backup & restore]: Force overwrite
Yeah the force-overwrite is actually what it's trying to do. This error is a bug that we're looking into. Thanksfor the report
4 replies
CCConvex Community
Created by RaFii on 12/18/2024 in #support-community
Can anyone give me the correct build command override for vercel?
from your screenshot there doesn't appear to be whitespace around the equals sign though, so i'm confused. what happens if you do the command npx convex deploy --cmd 'npm run build' ?
7 replies
CCConvex Community
Created by RaFii on 12/18/2024 in #support-community
Can anyone give me the correct build command override for vercel?
what doesn't work, and gets the same error you're seeing, is if there's whitespace around the equals sign
7 replies
CCConvex Community
Created by RaFii on 12/18/2024 in #support-community
Can anyone give me the correct build command override for vercel?
i just tried it myself and the command works with or without the equals sign
7 replies
CCConvex Community
Created by RaFii on 12/18/2024 in #support-community
Can anyone give me the correct build command override for vercel?
https://docs.convex.dev/production/hosting/vercel it looks like the recommended command doesn't have an equals sign
7 replies
CCConvex Community
Created by djbalin on 12/18/2024 in #support-community
Calling `ctx.runQuery` from `query`
I saw @erquhart typing and then stop, so i'll mention that we're looking into this behavior as inspired by his comment here https://discord.com/channels/1019350475847499849/1307399827033690233/1307404413438132345
4 replies
CCConvex Community
Created by djbalin on 12/18/2024 in #support-community
Calling `ctx.runQuery` from `query`
Here's a draft of part of the upcoming release notes, which should help with guidance. ( cc @ballingt ) Warn on direct Convex function call. This adds a console.warn whenever a Convex Function (mutation, query, action, internalMutation, etc.) is called directly
export const foo = mutation(...);

await foo(ctx);

export const foo = mutation(...);

await foo(ctx);

because this pattern causes problems and there are easy workarounds. The problems here: 1. Arguments and return values aren't validated despite the presence of validators at the function definition site. 2. Functions called this way unexpectedly lack isolation and atomicity. Convex functions may be writting assuming they will run as independent transactions, but running these function directly breaks that assumption. 3. Running Convex functions defined by customFunctions like triggers can cause deadlocks and other bad behavior. There are two options for how to modify your code to address the warning: 1. call the handler directly, after refactoring it out as a helper function. 2. use ctx.runMutation, ctx.runQuery, or ctx.runAction() instead of calling the function directly. This has more overhead (it's slower) and counts as a Convex Function call for billing purposes but you gain isolation and atomicity. See https://docs.convex.dev/production/best-practices/#use-helper-functions-to-write-shared-code for more. For now running functions this way only logs a warning.
4 replies