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

prisma migrations using T3 stack

prisma migrations are not setup in the T3 stack There is no script in package.json, or any documentation talking about migrations Is it on purpose? Do you want people to use npx prisma db push ? Or you want to give people freedom on how to handle migrations?...

R2 Presigned URL

I'm trying to figure out how or if I can somehow have the Object thats put in the presigned URL to have a expiration time as well and not only the url.

Is there any way gSSP in T3 stack

I'm going to start a new project, and the T3 stack seems like a good choice. But in T3 I tried gSSP to render pages on the server and couldn't work it out. Till now in my research I found that gSSP is slow that's why Theo has decided to not go with it (correct me if I'm wrong). But for my project I have a requirement to use gSSP, to be precise I want to use @vercel/og to generate og:image on the server. If anyone can help me with this, it would be wonderful ✨...
Solution:
if the issue is with gssp, you can check https://trpc.io/docs/client/nextjs/ssr

HOW TO SELF-HOST UPLOADTHING

How exactly do you self host the dashboard ?

Measure time user spends on my T3 website

Im trying to measure how many times and when users are logged into my website. Reason for this is that im building a website for studying and this would be a cool metric to show to my users. How could i achieve something like this in t3? Is there anyway i can use session data?...

Setuping NextAuth with Go Backend

If I am using NextAuth with Google login, how can I authenticate the user on a separate Go backend's API requests?

Clerk and provider access / refresh tokens

I'm currently using supabase for auth. One thing i found lacking though is that it doesn't automatically refresh the provider's (.e.g google) refresh token. I've already tried nextauth and afaik nextauth doesn't have this funcionality as well. So i googled if this is something clerk can handle, found this (https://clerk.com/docs/authentication/social-connections-oauth#o-auth-access-token-wallet ). Just wanted to confirm that as the docs say, whatever OAuth provider i use, i use call this endpoint (https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetOAuthAccessToken ) and clerk will give me an access token from the provider, while handling the refreshing of the tokens if necessary?...

Anyone know how to connect to custom domain?

I mean suppose I am creating a bloggin app, where users should be able to connect to thier custom domain, how can we do it?

Are NextAuth column names sensitive?

I've been starting a new project with drizzle (it's been nice to work in) and I had sessions working great! I decided that I wanted to rename the tables in my db and then everything decided to go to shit. So I'm wondering if maybe the names of the database tables is directly correlated to how nextauth works? My adapters are entirely updated to reflect the new table names, so that's why I'm a bit confused, but then again there have been weirder things in the past lol....

CORS nightmare

Hi everyone. I am currently developing a chrome extension, where I am fetching data from my nextjs api. The main problem here is that when I try to fetch data, I am getting a cors error, due to the extension’s origin being “null”. Does anyone know how to get the chrome extension to send its origin to the server? ...

open graph is not working

open graph is not working in next js 13 because it is not getting server rendered metadata can anyone tell me how can i server render my open graph in metatag website :- https://striversheet.pradeepbisht.com/ github :-https://github.com/pradeep800/striver-sheet-webiste/blob/main/app/layout.tsx if you check view page source it is adding script tag whcih should not be the case it should send html can someone tell me how i can i make this metatag render on server side...

QStash vs Custom Solution?

Hi all, In an app I'm building, I have a use case where Vercel is offloading some more complex processing to an AWS Lambda function via the JS SDK. Currently, the Vercel serverless function is waiting for the Lambda function to return as the return value contains needed data. With this solution, I have been running into issues regarding Vercel funciton timeouts (on the pro plan). ...

Create-if-not-exists multiple explicit many-to-many relations

(note: I'm new to using Prisma and unfamiliar with the syntax) I have Playlist and Video models, with an explicit many-to-many relationship (to hold extra data). Say I have an array of Video primary keys, how do I add these videos to a playlist, if they aren't already in it? My closest working example is this. To my understanding, upsert is actually an "create-if-not-exists, otherwise update" operation, but with an empty object for update thus working similarly to what I want (albeit slightly more complicated). However, here I am only adding 1 video to the playlist at once. Is there a way to add multiple videos (aka creating multiple many-to-many relations to the join table between Playlist & Video), ideally in one query? ```TS...

Trying to setup NextAuth with middleware.tsx file - login is happening but always returns to login

Trying to setup NextAuth with middleware.tsx file - login is happening and session is created in database but page never returns to page that is behind matcher. Middleware.tsx File is: import { withAuth } from "next-auth/middleware";...

throwing error is server action is not working in production

i am trying to throw error from server action and catching it in client it is working on development but it is not in production it is giving me given below error:- An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error. code is basically this :-...

How do you get query params in Next13, app router w/ route.ts file?

https://nextjs.org/docs/app/api-reference/file-conventions/route#parameters I am unsure of how you are meant to the get queryParams on the server site /api/route.ts file? I can find no mention of it? I am using the /app router and on the req: NextRequest parameter there is no req.query etc....

React table filter type error (.toLowerCase)

ts```<CommandItem key={option.label} onSelect={() => { if (isSelected) { selectedValues.delete(option.label);...

Prettier TailwindCSS not working with Next?

I just did a fresh create next app and i followed the instructions on the tailwindcss docs but its not formating my styles. I'm using next 13.4.9. Anyone know a fix?

White flashbang for millisecond before page load

So I'm noticing an issue where when swapping between pages on my site (/about, /home, etc.) it'll momentarily flash white before the styles are loaded. I'm using Astro and Tailwind, and even sticking a ```html <style> html { background-color: #040A0A;...