FleetAdmiralJakob 🗕 🗗 🗙
FleetAdmiralJakob 🗕 🗗 🗙
Explore posts from servers
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 1/6/2025 in #questions
Nuqs slower than useStste
Hi, today I started replacing a useState controlling the state of a dialog with a useQueryState of nuqs and it feels way slower now. Any ideas why it is like that? Is that normal? It makes the app feel way slower and kinda makes me overthink if it really is a good idea to put the state in the URL.
13 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 12/27/2024 in #questions
use(props.params) vs useParams() in Client Component in Next.js
What is better and more ideal in Next.js 15? Does using a different one make any difference? On Server Components the await props.params seems to be the way to go but on Client Components... I kinda tend on using useParams() to save a render but I'm not so sure about that. Any advice here? Im sure both work fine but I'm just curious in what works better.
14 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 12/26/2024 in #support-community
Is there a way to wait for what an internalAction returns?
I have a mutation that updates user data this mutation calls an internal action to update the user data in Clerk too. This action can fail sometimes, for example if an email doesnt meet all requirements. In this case we would need to catch the error in the action give it back to the mutation and then give it back to the client. How can I do that?
20 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 11/29/2024 in #support-community
Is Uploadstuff recommend for use or should I use plain Convex?
2 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 11/28/2024 in #support-community
[Convex Ents](bug): One to many edge with weird type
my schema looks like that
const schema = defineEntSchema({
// other ents

messages: defineEnt({})
// some fields
.edges("reactions", { ref: true })
// some edges
}),

reactions: defineEnt({})
// some fields and edges
.edge("message"),
});
const schema = defineEntSchema({
// other ents

messages: defineEnt({})
// some fields
.edges("reactions", { ref: true })
// some edges
}),

reactions: defineEnt({})
// some fields and edges
.edge("message"),
});
and I'm querying the data like that:
await message.edge("reactions"),
await message.edge("reactions"),
but as a type I get this back
(property) reactions: Ent<"reactions", {
_id: Id<"reactions">;
_creationTime: number;
emoji: string;
userId: Id<"users">;
messageId: Id<"messages">;
}, EntDataModelFromSchema<SchemaDefinition<{
privateChats: EntDefinition<VObject<{
support: boolean;
}, {
...;
}, "required", "support">, {}, {}, {}, {
...;
} & ... 1 more ... & {
...;
}>;
users: EntDefinition<...>;
clearRequests: EntDefinition<...>;
messages: EntDefinition<...>;
reactions: EntDefinition<...>;
}, true>>>[]
(property) reactions: Ent<"reactions", {
_id: Id<"reactions">;
_creationTime: number;
emoji: string;
userId: Id<"users">;
messageId: Id<"messages">;
}, EntDataModelFromSchema<SchemaDefinition<{
privateChats: EntDefinition<VObject<{
support: boolean;
}, {
...;
}, "required", "support">, {}, {}, {}, {
...;
} & ... 1 more ... & {
...;
}>;
users: EntDefinition<...>;
clearRequests: EntDefinition<...>;
messages: EntDefinition<...>;
reactions: EntDefinition<...>;
}, true>>>[]
which makes me get reactions with edge, edgeX and doc which I dont want but I only want this type (without edge, edgeX and doc)
(property) reactions: Ent<"reactions", {
_id: Id<"reactions">;
_creationTime: number;
emoji: string;
userId: Id<"users">;
messageId: Id<"messages">;
}, & EntInstance<EntDataModelFromSchema<SchemaDefinition<...>>, "reactions">
(property) reactions: Ent<"reactions", {
_id: Id<"reactions">;
_creationTime: number;
emoji: string;
userId: Id<"users">;
messageId: Id<"messages">;
}, & EntInstance<EntDataModelFromSchema<SchemaDefinition<...>>, "reactions">
3 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 11/24/2024 in #support-community
Upgrade from 1.17.0 to 1.17.2: Error: Could not find Convex client!
I upgraded my project that had no errors whatsoever from 1.17.0 to 1.17.2 and now get this error:
Error occurred prerendering page "/sign-in". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Could not find Convex client! `ConvexQueryCacheProvider` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app
Error occurred prerendering page "/sign-in". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Could not find Convex client! `ConvexQueryCacheProvider` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app
These are my providers: layout.tsx
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body
className={cn(
GeistSans.className,
"min-h-screen bg-background antialiased",
)}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<ClerkProvider dynamic>
<ConvexClientProvider>
<ConvexQueryCacheProvider>{children}</ConvexQueryCacheProvider>
</ConvexClientProvider>
</ClerkProvider>
</ThemeProvider>
</body>
</html>
);
}
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body
className={cn(
GeistSans.className,
"min-h-screen bg-background antialiased",
)}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<ClerkProvider dynamic>
<ConvexClientProvider>
<ConvexQueryCacheProvider>{children}</ConvexQueryCacheProvider>
</ConvexClientProvider>
</ClerkProvider>
</ThemeProvider>
</body>
</html>
);
}
convex-client-provider.tsx
"use client";

import { useAuth } from "@clerk/nextjs";
import { env } from "~/env";
import { makeUseQueryWithStatus } from "convex-helpers/react";
import { useQueries } from "convex-helpers/react/cache/hooks";
import { ConvexReactClient } from "convex/react";
import { ConvexProviderWithClerk } from "convex/react-clerk";
import { type ReactNode } from "react";

const convex = new ConvexReactClient(env.NEXT_PUBLIC_CONVEX_URL);

export const useQueryWithStatus = makeUseQueryWithStatus(useQueries);

export default function ConvexClientProvider({
children,
}: {
children: ReactNode;
}) {
return (
<ConvexProviderWithClerk client={convex} useAuth={useAuth}>
{children}
</ConvexProviderWithClerk>
);
}
"use client";

import { useAuth } from "@clerk/nextjs";
import { env } from "~/env";
import { makeUseQueryWithStatus } from "convex-helpers/react";
import { useQueries } from "convex-helpers/react/cache/hooks";
import { ConvexReactClient } from "convex/react";
import { ConvexProviderWithClerk } from "convex/react-clerk";
import { type ReactNode } from "react";

const convex = new ConvexReactClient(env.NEXT_PUBLIC_CONVEX_URL);

export const useQueryWithStatus = makeUseQueryWithStatus(useQueries);

export default function ConvexClientProvider({
children,
}: {
children: ReactNode;
}) {
return (
<ConvexProviderWithClerk client={convex} useAuth={useAuth}>
{children}
</ConvexProviderWithClerk>
);
}
I never had this error. It just happened while trying to upgrade.
25 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 11/20/2024 in #support-community
Preload query does not work with dynamicIO
No description
3 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 11/20/2024 in #support-community
Bug: Can't preload a page with pagination
No description
18 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 11/20/2024 in #support-community
Is there a way to enforce and check all my envs at build / deploy time?
Similar to how I can use https://env.t3.gg for Next.js
4 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 11/18/2024 in #support-community
Docs on mobile have weird break points
No description
5 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 10/27/2024 in #support-community
[Convex + Clerk + Next.js] Cant make static routes
No description
7 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 10/6/2024 in #questions
Use eslint-plugin-react-compiler with the new ESLint flat config
Is it possible? Does the plugin support ESLint 9 and above? If it is possible how can I use it? The example only shows the way to use it with ESLint 8 and below (no flat config)
2 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 8/26/2024 in #questions
[Next.js Image Component] Cache Images between pages
I'm using Tanstack Query to dynamically fetch data that includes an image URL, which I then load using the <Image /> component. On a different page, I fetch new data, but the image URL is often the same as the one on the previous page. The issue is that the same image gets loaded twice. Is there a way to reuse the image across both pages to avoid reloading it?
7 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 8/18/2024 in #support-community
Manually make requests
I have an open websocket connection to convex. How can I manually (not through code) make a request to my convex backend?
6 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 8/17/2024 in #support-community
[Convex Ents] Asymmetrical self-directed 1:many edges
Is that possible with Convex Ents? doesnt see it in the docs. Point is that I want a reply functionality. Which means that there is one message that replies to another (asymmetrical) but you can only reply to one message. But one message can be replied to by many messages.
26 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 8/14/2024 in #questions
Tanstack Table. flexRender
No description
5 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 6/24/2024 in #support-community
Git annoyance
No description
5 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 6/22/2024 in #support-community
Convex Query is called multiple times even in production build
No description
5 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 6/20/2024 in #questions
Post Quantum Encryption
Does somebody here knows a good library to use if you want post quantum encryption for your messaging app? I looked at libsignal, the implementation from signal of the signal protocol but it seems like it's only providing the frontend functions for typescript and it's only designed for the use inside signal
9 replies
CCConvex Community
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 6/19/2024 in #support-community
data privacy mode
I want to build an app where every data stored in Convex needs to be treated very carefully and ideally cant even be seen by the owner of the program (us/me). Is there a mode where I can't access the production data only the users? The other option would be to encrypt it manually.
8 replies