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

Running migrations on startup

First of all, hey there, I hope you are doing well. My question as a new next js space/ecosystem is revolved around db migrations. I'm building an app that aims to be easily self-hostable, but currently, I'm unsure what the best approach is when it comes to applying and continuously rolling out new migrations. I would imagine that running some code before server next js server start is what I am looking for. ...

I think somethings really wrong with my tailwind or styles

So I have this issue where if i reload the page, the styles changes somehow. But if i re-render it, with just going back and forth on the website, it looks just fine. It's only on the initial load of the page. Really werid, have no idea what's causing it, and i can't find anything about it. If anyone has any idea, or a way to debug what's happening, pls help...

TRPC and protectedProcedure with next-auth

Has anyone ever experienced an issue with a new t3 app with next-auth and trpc where a protectedProcedure for a mutation stays pending and multiple session requests are also pending when you're signed in? I've also added a log to the middleware on the enforceUserIsAuthed and it never seems to get called. Also, when this happens I have to remove the .next folder and start the dev server again, otherwise clearing the site data and hard refreshing doesn't even load the page anymore. ...

How do you guys make http calls to external backend from both client and server in nextjs?

On SPA its usually single httpTransport, but I can't understand how it suppose to work on backend (getServerSideProps) and frontend (client components) at the same time. Should I make a common httpTransport and use it everywhere, but wrapped with react-query on frontend, for example? Or everybody just use fetch, node-fetch?

Password hashing

Can someone help me find function to hash password and verify it that works in Cloudflare Workers

SSR and page transitions

Short story! Can I have any type of page transitions when all pages are SSR? I've tried putting it in a template.js and wrapping layout in framer motion but no, There's a transition on first pageload only...

How to access Next Auth session or jwt from axios interceptor

my goal is to add the authorization header on the interceptor without doing it manually on every request except the function getServer() returns null and useSession is only used on the client obviously and the getServerSession needs access to the context

My expo build cant find packages folder

Here is the log None of these files exist: * ../../packages/db/prisma/client(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.cjs|.native.cjs|.cjs|.ios.cjs|.native.cjs|.cjs) * ../../packages/db/prisma/client/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.cjs|.native.cjs|.cjs|.ios.cjs|.native.cjs|.cjs) > 1 | export * from "./prisma/client";   | ^...

empty tables in drizzle studio

Hi, i created new next project where i tried to setup drizzle, next auth and trpc, and so far i succeed. But i want to add role to user, and for some reason it didn't worked, soo I wanted to check in database did I added column correctly I run yarn drizzle-kit studio and I see that all tables are empty but I'm able to sign in and sign out using Discord Provider? Did I miss something in config or?...
No description

Custom domain with uploadthing

Hi, I checked out uploadthing and it's pretty cool, can't find any option to connect a custom domain on the dashboard or how to do it in the docs, please help me connect my domain with uploadthing.... Thanks :D...

Help getting my login button to redirect the user

I want to make it so that after a user signs in and gets a session, they get redirected to a previously protected page. Additionally i want the logout button to redirect the user to a unprotected landing page. However my current attempt is not working. My login form successfully gets a session created (I know this because when I navigate to the protected page I can see it)...
No description

get user ip in trpc

I know https://www.answeroverflow.com/m/1097080265928609802 in here the question is already answered but i get value in ip as ::ffff:127.0.0.1 this instead of real ip here is how I do that ```ts export const createTRPCContext = async (opts: CreateNextContextOptions) => {...

NextAuth: How to protect route groups without middleware?

Because I'm not using SSR, I don't have access to middlewares. My first idea was moving useSession({required: true}) up, from my pages to my layout. But that's not working out because useSession() only works within <SessionProvider> {children} </SessionProvider>....

Images not rendering

I just uploaded a project on Vercel, but some images are not rendering. It was made with pure HTML, CSS and JavaScript and it was working fine in my localhost. Someone help me please!

How are you guys reviewing your apps with customers / test teams?

How are you guys going forward when testing your app/website with customers (agencies) or the rest of your team/execs during staging? I knowmany say you should test your app design with figma, but a: ain't nobody got time for testing everything in there, b: it doesn't represent the real piece of software, c: it doesn't evaluate functionality on every device. Right now, we use a slack channel that get's filled with screenshots and notes everytime someone sees a problem in the staged preview, but then again you miss out on the technical debug info you would need and so on. Do you use any certain tools for that kind of stuff? ...

Learn React or Learn Blazor i already know c#

Im going to do a BIG project leveraging 4 APIโ€™s on AI gonna have to implement a Login function as well as a Payment gateway and a database to store all the users. Gonna have to keep track of these users if theyโ€™re on the Pro plan or the free plan. I already know a lot of c# and thought of learning blazor to complete this project. But thought that something like react would be more suitable for something like this. I have time to do this until 20th of April and im stuck between these 2 options: 1.) Learn Blazor to complete the project with it. 2.) Learn React and Javascript and do the project with it. ...

tRPC Context object empty

Hey guys, I wanted to try to implement context using tRPC. I followed the docs line by line but I keep getting an empty object when I return the ctx in my procedure. Here is my code:...

is there caching in tRPC

I am trying to fetch new data on state change, const [categories, setCategories] = useState<categoryType[]>([]); // Initialize with an empty array useEffect(() => { const getCategories = async () => {...

import pageData... VS pageData = await fetchPageData()...

In a SSR nextjs 13 app directory situation I though it was a simple and good idea to import the data and filter it for each page but I have experienced some stalls of the app that never resolves. Now I am rebuilding it using fetch-calls instead. Any angles on that?...

Unhandled Runtime ErrorRangeError: Maximum call stack size exceeded

I have a server action that invalidates a user session when they click a button (a Signout button). Howeer when i click the button, i get the attached error. Does anyone see anything immediately wrong with this code?...
No description