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

turbo clerk auth not working

Just cloned repo from official clerk-turbo template. My app runs just fine, untill I try to log in. I've changes oauth strategy to google, and it works.. kinda. It loads the browser, lets me provide all google credentials, lets me submit, but does not login. Just nothing. No errors, nothing....

Struggling to add client-side environment variables

I am trying to add a client-side env variable to my env.mjs... I added it to the .env file, like so: FOO_URL=https://example.com/...
Solution:
I fixed it... I changed the runtimeEnv object to the following: ` runtimeEnv: {...

TypeError: URL is not a constructor

Anyone know how to fix this error? It came out of no where as I was building my create-next-app@latest. Things I've tried: - Restarted VS code and Mac...

Hiding ICE Servers connections

Does anyone know how to properly avoid exposing my TURN server in the client or is it unavoidable? My first thought was to store it in my .env but in the end I still call it in a page so I am confused right now. Another thing that I saw was to get it from an api route but then I would need temporary username and credential which I still don't know how to implement. My TURN server is currently in AWS EC2 and everything seems to be working fine. ```tsx...

Stackblitz or Codesandbox - Remote Development

Hi, I've been doing Remote Development through GCP and Oracle, So after free trails, the plans are expired. I've tried using Stackblitz, But its not convenient to use. I'm currently looking for other platforms, Have you guys got any suggestions ?...

issue with prisma studio part (tutorial)

so ive been following the yt tutorial for the t3 app and when i did npx prisma db push it errors out when accessing prisma studio

tRPC on the Edge?

Anyone have success with this?

Typescript wizards needed! Circular dependency with Zod inferred schema type withing superRefine()

I have a zod object and I have a superRefine() call on the object to do additional validation. I want to separate the function call from the function within superRefine() to another validation function that accepts (val, ctx) and performs the validations/adds issues there (see below example. It works functionality wise however the issue is when I use the z.infer type of the schema to provide the type of the val parameter I get a circular dependency error. ...

Loading file or suspense?

So I have a basic dashboard page and want to show some loading state for a server component. ```tsx import { Suspense } from "react"; import Loading from "@/app/dashboard/loading";...

What is the easiest way to get your content from the trpcState

Is there an easier way to get these values? const post = await helpers.post.getPost.prefetch({ slug }); console.warn(post); ...

Clerk: auth() was called but it looks like you aren't using authMiddleware in your middleware file

I'm using the nextjs app dir, and my middleware is definitely being called: ``` export default authMiddleware({ afterAuth: async (auth, request, evt) => { console.log("hello from middleware")...

Data coming back as undefined in T3 Stack Tutorial

I'm following the T3 tutorial and am having trouble with getting the tRPC query to resolve. I followed the tutorial up until ~26 min where I am trying to render the posts from the prisma database but data keeps coming back as undefined. And when I destructure isLoading as well, that is always true so it seems like it never finishes loading the query. const { data, isLoading } = api.posts.getAll.useQuery(); Anyone else run into this issue when following the tut? I have no clue what to do to fix it? Do I just move on and hope future code in the tutorial fixes the issue?...

Questions from someone new to T3 stack

Hey guys 👋 new to t3 stack so had a couple of questions: 1. has t3 moved to next 13.4? 2. is trpc still required with next 13.4? because functions are in the same repo and can be imported between client and server so it should all b type safe (i guess) ...

Middleware is not working

I am following the T3 stack tutorial and am running into an issue where my middleware just doesn't seem to be recognized. I have the exact same code as in the tutorial and it's in the same folder as in the tutorial but the console log is not coming through. Anyone else run into this issue and have a fix for it? `import { withClerkMiddleware } from "@clerk/nextjs/server"; import { NextResponse } from "next/server";...

How to provide more info on ctx.session.user in the routers?

I gave my users a role and would like to have access to it with the context when I do a protectedProcedure.

Choosing a React framework-thing

TL;DR need to build simple frontend for tool, what should I use? Hey! I'm going to be building a request profiler at/for work and I want it to have a simple UI to make it easier to look through the output etc. React is pretty much the only frontend library/framework I've spent over 1000 hours with with (I'm a jr. backend dev, will be taking on a more fullstack role soon), so I think I want to use that for it. Question is, which of the React frameworks/stacks should I choose? I like t3 a lot, but I don't think I really need Next for this as it's probably going to be a single page anyway. I've used Astro before, but that too seems like overkill for such a task. People seem to not recommend CRA for reasons that I'm too junior to get into, but maybe it's good for something like this? Do I even need React or would vanilla JS suffice (without taking 2x long to build). SEO is irrelevant ofc since it's just an internal dev tool, as is perf to a certain extent. ...

Sentry Next.js setup issues

I am not getting my client side errors from my Next.js application to show up in Sentry. I have used the wizard and the api error from their example is showing up in Sentry but the Sentry Example Frontend Error is not and not my own errors I throw on button presses to test either. Does someone have any ideas on how I could resolve it?...

Understanding sockets with t3, looking for tutorials

Has anyone produced any guides for implementing websockets with t3? I'm aware of the zapdos repo and socketi but looking for something more step by step to help me understand how it fits together. My app flow would be - User A hosts a room which generates a code/URL, names themself - User B joins the room with the code/URL (and the room is now full), names themself...

How to get started with next 13?

How to get started in T3 app with next 13?

bundle size and browser performance

I'm comparing framer motion and motion one for my react app regarding bundle size and Page Speed Insights performance metrics. I'm trying to use PSI but it seems very inconsistent with its scans favoring one over the other at times. Does anyone have suggestions for use PSI better or using other analyzers? Also suggestions for Network tab to help? Currently installing a bundle analyzer...