gnarley_farley.
gnarley_farley.
Explore posts from servers
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 11/13/2024 in #questions
How do you get the session in middleware?
getServerAuthSession throws an error.
3 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 10/8/2024 in #questions
How to Scroll down to bottom of cli T3turbo.
The cli always seems to get stuck, then you have to scroll for ages to get to the bottom. Does anyone know how to fix this?
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 10/1/2024 in #questions
Latest t3 Template issues
Have to restart the TS server the whole time just to remove squigglies and having issues with imports. Brand new install. Just came off a very long t3 turbo project. Never had any of these sorts of problems. Are there any known issues with the latest template and windows?
3 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 9/26/2024 in #questions
How to setup api service for selling with nextjs t3?
Anyone know of a good t3 or t3 turbo template/project that shows you how to setup an API service that you sell. Like fal.ai / together.ai. Kind of setup. I just wanna spin up a bunch of serverless llm endpoints and then charge people to use them.
13 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 8/1/2024 in #questions
USing the latest t3turbo with prisma
No description
4 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 7/31/2024 in #questions
Issue with T3turbo - Terminal Scroll to bottom and Not being able to select text
I have an issue with myt3turbo project. firstly the terminal does not automatically scroll to the bottom, meaning when i want to debug i have to manually do it everytime. Secondly, I am unable to copy paste any text from the terminal. Is anyone familiar with this setup and why i may be facing these issues?
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 7/24/2024 in #questions
Is there a reason i cannot use "use server" inside buttons anymore like the example shows.
No description
14 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 7/3/2024 in #questions
Have to refresh typescript server after pnpm -ui add of components (TURBOREPO)
For some reason i have to refresh my typescript server after every component I add (otherwise squiggly lines) . Does anyone else have to do this?
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 5/7/2024 in #questions
How do i debug my expo app
No description
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 5/6/2024 in #questions
Error when trying to spin up turbo repo
No description
5 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 2/2/2024 in #questions
How can i get session.user.id from nextauth when using the edge runtime?
I need to pass the session.user.id into my prismadb from the edge runtime. Any ideas?
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 1/17/2024 in #questions
I has a long-running server task. I want to update my db afterwards. It's on the edge.
Should I use TRPC on the edge runtime or prisma or update by supabase db direct? what's the cleanest way to do this. I don't want to do it in my component.
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 1/5/2024 in #questions
Trying to get shadcn themes to work. How can i dynamically adjust the
@layer base { :root { --background: 0 0% 100%; --foreground: 20 14.3% 4.1%; --card: 0 0% 100%; --card-foreground: 20 14.3% 4.1%; --popover: 0 0% 100%; --popover-foreground: 20 14.3% 4.1%; --primary: 24.6 95% 53.1%; --primary-foreground: 60 9.1% 97.8%; --secondary: 60 4.8% 95.9%; --secondary-foreground: 24 9.8% 10%; --muted: 60 4.8% 95.9%; --muted-foreground: 25 5.3% 44.7%; --accent: 60 4.8% 95.9%; --accent-foreground: 24 9.8% 10%; --destructive: 0 84.2% 60.2%; --destructive-foreground: 60 9.1% 97.8%; --border: 20 5.9% 90%; --input: 20 5.9% 90%; --ring: 24.6 95% 53.1%; --radius: 0rem; } .dark { --background: 20 14.3% 4.1%; --foreground: 60 9.1% 97.8%; --card: 20 14.3% 4.1%; --card-foreground: 60 9.1% 97.8%; --popover: 20 14.3% 4.1%; --popover-foreground: 60 9.1% 97.8%; --primary: 20.5 90.2% 48.2%; --primary-foreground: 60 9.1% 97.8%; --secondary: 12 6.5% 15.1%; --secondary-foreground: 60 9.1% 97.8%; --muted: 12 6.5% 15.1%; --muted-foreground: 24 5.4% 63.9%; --accent: 12 6.5% 15.1%; --accent-foreground: 60 9.1% 97.8%; --destructive: 0 72.2% 50.6%; --destructive-foreground: 60 9.1% 97.8%; --border: 12 6.5% 15.1%; --input: 12 6.5% 15.1%; --ring: 20.5 90.2% 48.2%; } }
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 12/8/2023 in #questions
What's the best way to handle WebSockets and streaming for these AI apps + t3?
How you do this?
5 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 6/6/2023 in #questions
When using Zustand in a mono
How should i set it up , should i have a separate store for every project?
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 6/4/2023 in #questions
WHEN to not use SSR?
can someone explain to me when not to use SSR? I never want to see a loading indicator when i open a new page. So i dont really understand when not to use it. In the past i've generally used SSR on all slug pages and not or some index pages that are not important for SEO. But why not just use SSR with revalidation on every single page? The pages load faster and the data is never stale either way so why would i not just use this across the whole applciation?
3 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 6/2/2023 in #questions
Desperate for help with Trpc resolver.
How can i get resolve({ default: base64Data }); to only trigger once trpc has returned success or failure. class MyUploadAdapter { private loader: any; private mutation: any; constructor(loader, mutation) { this.loader = loader; this.mutation = mutation; } private async _uploadFile(file: File) { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onload = async () => { const base64Data = reader.result?.toString().split(',')[1] || ''; // mutate will automatically handle success and failure. try { await this.mutation.mutate({ base64Data, }); resolve({ default: base64Data }); // Since mutate will handle success and failure, // you don't need to manually check for errors or success here. // Instead, just resolve with the base64Data, // and CKEditor will handle the result. } catch (error) { // The error is caught here but it has already been handled by the onError handler. reject(error); } }; reader.readAsDataURL(file); }); } }
14 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 5/31/2023 in #questions
A question on procedure design.
I would like to know if it is best to try combine procedures or keep them separated. I don't want to repeat myself but am not sure regarding best practices for this types of thing. Would appreciate if someone could push me in the right direction. Something like this for bookmarks on 2 different post types bookmarkPost: protectedProcedure .input( z.object({ postId: z.string(), }) ) .mutation(async ({ ctx: { prisma, session }, input: { postId } }) => { await prisma.bookMark.create({ data: { userId: session.user.id, postId, }, }); }), bookmarkTech: protectedProcedure .input( z.object({ techId: z.string(), }) ) vs. combined bookmarkItem: protectedProcedure .input( z .object({ itemId: z.string(), itemType: z.string().refine(value => ['post', 'tech', 'course'].includes(value), { message: "Item type must be either 'post', 'tech', or 'course'", }), }) ) .mutation(async ({ ctx: { prisma, session }, input: { itemId, itemType } }) => { switch(itemType) { case 'post': await prisma.bookMark.create({ data: { userId: session.user.id, postId: itemId, }, }); break; case 'tech': await prisma.techBookMark.create({ data: { userId: session.user.id, techId: itemId, }, }); break; case 'course': await prisma.courseBookMark.create({ data: { userId: session.user.id, courseId: itemId, }, }); break; default: throw new Error("Invalid item type"); } }),
6 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 5/23/2023 in #questions
What is the easiest way to get your content from the trpcState
2 replies
TTCTheo's Typesafe Cult
Created by gnarley_farley. on 5/22/2023 in #questions
How to solve infinite compiler loop when using withNx and withContentlayer together in next.config
trying to figure out how to configure contentlayer with my t3 app in an nx monorepo. if anyone has some ideas, please hola.
2 replies