Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

getting error while fetching from uploadthing

i am creating a next.js project where user can upload pdf file which we save using upload thing and later analyse it using open ai api. pdf file is getting uploaded correctly but getting an error while fetching the file: i have tried a lot, it will be really great if anyone can help...
No description

Next Auth google says redirect URI is broken but works on another project

Hi! I am working on a project and I keep getting the error: Access blocked: This app’s request is invalid ...

Next not doing SSG routes?? Am I missing something?

Hi, I need to do this page ssg instead of dynamic server rendered, i dont have any dependencies so i have no idea whats happening, gemini or chatgpt has no clue either....

How to fix jupyterhub issue

Anyone have any experience with jupyterhub? I'm getting: TimeoutError: pod jupyterhub/jupyter-zfjryuibwedbvgjvmxrvjcfjybevht did not start in 300 seconds! ...

P3005 Error running Prisma migrate

I am working on a NextJS project that uses prisma. I was able to define my initial schemas and deploy my initial migrations successfully. I made a small change in the diff screenshot attached to this message and I am able to run npx run db push with no issues. When I try to run npx prisma migrate dev to generate a migration, I get the following error: ``` Error: P3005 ...

UTApi - server SDK uploadFilesFromUrl module error

I am getting a weird bug when uploading images using the utapi uploadFilesFromUrl. This is my server code for now, which is very similar to the one posted in the example. I am using bun, elysia, and the code is written in TypeScript. ``` const urlExample = "https://cdn2.hubspot.net/hubfs/53/image8-2.jpg";...

Vercel Date Issue

understand that Vercel servers have different dates compared to the client's date. Typically, this is resolved by marking a component as 'use client' to generate dates on the client side. However, I'm encountering an issue with my app's calendar feature. When the client sends a date to the server to fetch events, there's a discrepancy between the client's date and the server's date. This leads to events not being displayed correctly. For example, if I request events for April 11th, but the event's date in the database falls between 5:29 AM and 11:59 PM, it won't be displayed for that day. However, if the client's date is April 10th, then the event shows up. Events with dates between 12:00 AM and 5:29 AM work fine....
No description

Request -Website to analyze npm packages

Theo made a video on it but I forget the website name and cant find the video. The tool analyzes and NPM package and sorts it where you can see the functions, types , etc

Date being overridden in neon and drizzle orm

Hey! when I'm trying to store a date in drizzle orm and neon the date that's being written is overwritten here is the table: ```ts export const meetings = pgTable( "meeting", {...
Solution:
The date type doesn't contain hour/minute/second data and thus doesn't map well to a js date, it may be a good idea to try to use string mode instead or not use the date type at all and use a timestamp instead

What is a correct API route validation flow

I'm currently creating a learning platform similar to udemy just for some practice using Next.js (pages), Prisma, auth0, TypeScript, Postgres, Zod and I'm trying to create an API route for creating a new course. What should the flow look like in this API? (Idk if flow is the right word or if my title makes sense. correct me if I'm wrong) In order possibly?:...

API Monitoring, Logging from Scratch

Hello folks I have an assignment where I want to develop a rest monitoring tool where that tracks the status code, the method, response body, request body, cookies and tokens and every other important parameter whenever I send a request to a server How can I do this actually?...

downsides to Using IndexedDB/LocalStorage as a cache?

I'm making a chat app where the user can send/receive messages, which are stored in supabase. I want to cache these messages client-side using IndexedDB or LocalStorage to allow users to instantly view their messages upon page exits and re-entries, without fetching from the db every time. To me, this just seems idiomatic, allowing for instant loading as well as saving bandwidth "localstorage/indexdb can be cleared by client" -> all caches get stale sometimes, just refetch "your localstorage is not accessible on other devices" -> that's fine, just fetch from server like normal "5mb limit for localstorage" -> indexedDB is limited by disk space...

You are using Node.js 16.17.0. For Next.js, Node.js version >= v18.17.0 is required.

i have installed the latest version of next js via npx create-next-app@latest i have node js version 20.12.1 i checked with node -v , i have also checked the path variable it does point to my node js folder ,i reinstalled node js , but unfourtuntely that all didn't work i am using npm run devto run the project

Do TRPC fetches need to be wrapped in react.useeffect?

I'm curious on how the use of TRPC api calls works with client and server components. Does TRPC handling the caching of results or do we need to still wrap our calls in a react use effect to prevent unnecessary calls? thank you!

i have a doubt regarding google oauth token

bro i have a doubt . i have made a chat app with pocketbase with gmail oauth thing now i want to push it to github . will my oauth token be exposed ?

next js on vercel revising home page after 404 does not re-render

Hi, I have a t3 stack app (basic but with clerk and not next auth). on local wen I navigate to my broken 404 page and back home, everything seems to be find but on production (vercel) when I go back to the home page, it does not re-render and stack on the 404. Any help will be appreciated... I am using chad cn for the navbar, this is the link component: ```...

React Table v7 Sorting

I have a question regarding react-table v7, its not possible to have server side sorting with the table doing the handle the sorting, right ? From what I see on the examples, if I have client side sort I can have the table take care of it, but If I want it to be server side I need to handle all the logic including function to sort, icons (ascend, descent) etc. Right now I have server side pagination working but the sorting is still being handled by the table and what happens is that the sorting is only applied on the page itself (so for the first 40 elements, being 40 my limit). Im pretty sure I need to do all the logic, I just wanted to avoid having extra work and style everything....

Updated T3 Tutorial

Apologies if this has already been explained recently. But did Theo mention releasing an updated t3 stack tutorial in his last stream? I thought he had but might have misinterpreted

Error with NextAuth and prisma

I am using the google provider with nextauth and prisma along with supabase, and I get this error when trying to sign in, ``[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR] https://next-auth.js.org/errors#oauth_callback_handler_error Invalid prisma.account.findUnique()` invocation: ...