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

Github codespaces connecting to supabase

I have a react project that uses supabase. I'm playing around wiht github codespaces. The project runs fine in github codespaces and my supabase instance is running fine but i get this error when I try to run the app: Access to manifest at 'https://github.dev/pf-signin?id=8xtp2drf&cluster=usw3&name=cautious-goggles-96w4rq47vprh9xgp&port=8100&pb=https%3A%2F%2Fcautious-goggles-96w4rq47vprh9xgp-8100.app.github.dev%2Fauth%2Fpostback%2Ftunnel%3Frd%3D%252Fmanifest.json%26tunnel%3D1' (redirected from 'https://cautious-goggles-96w4rq47vprh9xgp-8100.app.github.dev/manifest.json') from origin 'https://cautious-goggles-96w4rq47vprh9xgp-8100.app.github.dev' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. This happens on a preflight check. (I'm not very familiar with CORS suff) ...

Database Query Insights (local MySQL)

I'm using Prisma + MySQL. I'm trying to optimize some queries. What is the best way to get query insights on a local MySQL instance?

trpc with Next 13 and App router

Hi, I previously built something with the t3 stack and was wondering how we can migrate or start a new project in next 13 ? Anyone using those together?

Re Render default radio checked

React gives the following example of handling default values of inputs, specifically on radio buttons. https://react.dev/reference/react-dom/components/input#displaying-inputs-of-different-types. For some reason, when I implement this the re render on refresh does not render correctly. The value is set correctly, but the render looks like it sets it, then unsets it. Has anyone experienced this before? I will note, that when I change the name of the inputs, it doesn't do this, but instead rendes the default value correctly. The below would set it correctly. ```<label><input type="radio" name="myRadio1" value="option1" /> Option 1</label? <label><input type="radio" name="myRadio2" value="option2" defaultChecked={true} /> Option 2</label>...
No description

Microsoft Login W T3

Howdy! I followed this guide to the T https://microsoft.github.io/MicrosoftCloud/tutorials/docs/Authentication-App-With-NextJs-And-Microsoft-Graph/. Unfortunately I think I might be off base in this approach as I am getting numerous errors when trying to sign in (I think this is moreso for internal organizations / internal oauth with company AD accounts?!) Either way, I would essentially like to know if anyone knows how I can reproduce the microsoft login flow that Theo and team implemented for ping.gg...
No description

tRPC Express server with Next.js

As much as I hate this, I am required to use Express for back-end and Next.js for front-end. I have two Node.js projects, an Express server and a Next.js client. I did a minimal setup on the back-end side using the Express adapter and it is working fine when i try to hit an endpoint on the browser....
No description

WordPress Landing + NextJS Dashboard

What’s the best way to combine a wordpress landing page to a nextjs dashboard with the same domain? Wordpress -> domain.com NextJS Dashboard -> app.domain.com...

custom verify-request page nextauth

So i want users to be able to copy the code that is sent to them by an email and put it into the input to verfiy the email signin, however i can't seem and documentation on how to do it or any examples. does anyone know how i could achive this?...

Database-Js for non planetscale database?

I run the MySQL container mysql:8.0.31-oracle for local development from a docker compose file, and planetscale in prod. Does anyone know if database js works with a non planetscale database? My attemps to make it work haven't been successful so far

❌ Invalid environment variables

I recently created a new t3 application using the pnpm create t3-app@latest command. After setting up all the necessary environment variables, I was able to successfully start the development server using pnpm dev. The application was functioning as expected, with both the database and authentication working properly. However, when I attempted to use the pnpm drizzle-kit studio command, I encountered an issue. The attached image provides a visual representation of the problem. I would appreciate any assistance in resolving this issue. Thank you....
No description

Breaking-border on input fields

Does anybody have any resources for me to look at, or any examples on how to actually do a breaking-border label for a input field? Similar to how material ui's input fields look. There's a few strategies I know of, which is using clip path (and calculating the width of the label) or using psuedo elements with a background color on the label itself. Both have their own issues, the clip-path strategy is just plain ugly and annoying, and the background color strategy will only work on one background color. Is there a better way to go about it? Thanks!...
No description

DatePicker for react-native

I need to build a date-picker as it is shown on the pic and I need it fast ;D Are there any libs that could help me?...
No description

Which cms should I use in t3 stack and plantscale?

Which cms should I use in t3 stack and plantscale?

Next seems to not be respecting the layout.tsx

Attached is my layout.tsx in the root of the app directory. However When I navigate to subpages, sometimes the navbar (which in the layout.tsx) isn't there, (until I refresh the page). Also, when I navigate back up to the home page via links, the header is also gone in the home page. Why might this be the case where I have to refresh the page for the Navbar in the layout.tsx to appear?
No description

UploadThing spamming terminal with: "dev server is now running"

I am using the uploadthing useUploadThing hook in my NextJS project. The hook runs every time a modal renders, causing it to call the UploadThing API, which in turn spins up a dev server. The thing is the modal has quite a lot of state causing it to rerender often. This results in the hook constantly calling the API and my terminal getting spammed with "[UT] UploadThing dev server is now running!". Is there some way to cache / make this hook global so it ONLY runs ONCE when the page is loaded?...

Next Auth middleware redirects me to the login page, even if there's a session

I am busting my head around this thing. I tried to setup NextJS with NextAuth, Drizzle and PlanetScale. So I am not using the T3-scaffold. The thing is that I can see that there's a user returned from getServerSession. But when I add my middleware.ts file. It just keeps redirecting me to the login page. As if there would be no session the middleware could recognize. Any ideas to why?...

React components not rendering in mdx (contentlayer)

Attached is my MDX file and a screenshot of it rendering on the page. How can I import and use components in the posts, such that contentlayer correctly renders them in the final page?
No description

TRPC / Prisma findMany not showing properties in auto completion

Ive been pulling my hair out for the last hour and cannot seem to find whats happening. In my TRPC router, I have the following very simple procedure defined (initially a unique model but seems to be a problem with everything using FindMany):
getAll: protectedProcedure.query(({ ctx }) => { return ctx.prisma.example.findMany(); }), ...
No description

Use trpc on nextJS api route?

Is there a way that you can use trpc on a nextJS api route?

how to remove all current data from planetscale main branch?

I made a breaking change and need to reset the main branch in order to deploy it, how to do it?