rykuno
rykuno
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Lopen on 6/5/2023 in #questions
drizzle orm is overhyped
If you don't use serverless then use what you like??? I have two apps that utilize prisma that are hosted on Render.com; great performance. Yet it does suck incredibly on serverless apps, like, bad. Each has their pros and cons; but there's no arguing that if severless continues to increase in popularity then either prisma needs to figure out their cold starts or it will lose popularity pretty quickly. I'd love to use prisma on serverless apps but I cannot risk churn through 6 second cold starts vs Drizzle's 100ms
68 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
well the temporary work around is to just call it straight from a server component I guess. Im on 13.4.1 so I'll keep my eye out for a fix I suppose.
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
Server Actions cannot be defined within Client Components, but they can be imported. To use Server Actions in Client Components, you can import the action from a file containing a top-level "use server" directive.
Server Actions cannot be defined within Client Components, but they can be imported. To use Server Actions in Client Components, you can import the action from a file containing a top-level "use server" directive.
https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions#examples
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
According to their docs it should be 100% allowed.
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
I'm not the first to discover it apparently https://github.com/vercel/next.js/issues/49235
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
Its called on the client, but the action itself is a server action. Thus it shouldn't matter if a server or client component calls it so long as its done in the appropriate manner
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
This snippet when called from a form action within a client component will not have access to cookies; which seems wrong?
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
Its actually not a NextAuth issue I found out. The error was w/ accessing the browsers storage so I tried to access cookies just for fun
export async function createEvent(formData: FormData) {
"use server";
cookies().getAll();
}
export async function createEvent(formData: FormData) {
"use server";
cookies().getAll();
}
It gave the exact same error
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
Okay hold the fuck up. If I call a server function from a server component I can access getServerSession. As follows
import { createEvent } from "./_actions";
import EventCreateForm from "./form";

export default function EventCreate() {
return (
<div className="">
<EventCreateForm createEvent={createEvent} />
</div>
);
}
import { createEvent } from "./_actions";
import EventCreateForm from "./form";

export default function EventCreate() {
return (
<div className="">
<EventCreateForm createEvent={createEvent} />
</div>
);
}
But If i call the function from a form action, it errors out. Shouldn't both be called on the server side thus have the same access to the cookies????
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
no edge runtime
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
this is locally
29 replies
TTCTheo's Typesafe Cult
Created by rykuno on 5/7/2023 in #questions
Next-Auth Session in Server Function
This is a server function in a file actions.ts co-located along pages.tsx
29 replies
TTCTheo's Typesafe Cult
Created by Shoodey on 1/24/2023 in #questions
trpc call inside getServerSideProps?
What I found way easier than SSG Helpers is just restructuring your TRPC endpoint to be a proxy in a sense. All my logic inside my trpc handlers are abstracted to a different file so I can simply call that function server side from nextjs
15 replies
TTCTheo's Typesafe Cult
Created by rykuno on 1/17/2023 in #questions
Prisma `clientExtensions` Preview Feature Breaks Types
@Cashed what version of prisma are you running where its fixed btw? Is it the latest stable or a rc
4 replies