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

Mongo Db Schema _id(ObjectId) in trpc get serializes to string

Hello there, In the mongoDB schema there is _id field with the type of ObjectId. But during serilization from trpc on the server its get converted to a string type. On the client the Mongo DB type gives a error that the _id type is string and not ObjectId. ...

Debugging node_modules in VS Code of a Next.js app

I'm trying to set breakpoints inside an installed package, but the breakpoints are unbound, since the dependencies are bundled with webpack. I'm using the following lauch.json taken from https://nextjs.org/docs/pages/building-your-application/configuring/debugging#debugging-with-vs-code ```json {...

Bad Request 400

I really couldn't fix this problem I am sure of all the api, secret code data is correct
No description

How to setup initial db and application configs?

There's either Supabase app I created or local Postgres instance but I couldn't figure out what to use here besides not finding any documentation about it. Can anyone point me out any useful hint or a link?

Use ReactQuery to fetch different api resource than trpc resource

I have an api endpoint which I can call using fetch. How one would re-use reactquery and call that endpoint directly. Do I need separate reactquery client?
Solution:
You should already have @tanstack/react-query installed as a dependency, you can just import useQuery from it, it will use the same query client as trpc

email client

Does anyone know what an email client is ? - I have been given a task to set up an email client on Amazon ec2 - i don't have an understanding of what an email client is - I thought it is used to send emails to logged in users of our website like remainder emails like that -but the CEO told me that we have separate emails for all our employees what does that mean ...

React Native

Hello, I am making a react native app. Can someone please point me in the right direction? I am making a signup screen that has several different screens that I will need to get info from in the signup process before creating that user. Is this a good use case for useContext?

Integrating AI assistant (fastapi/react) on the main website(laravel).

I’m currently developing a chatbot using FastAPI, LangChain, and React and am looking to integrate it into my Laravel application. I initially tried placing the React app’s build folder into Laravel’s public directory and created a route for it. While this approach works, I’ve encountered an issue: when navigating between routes, the chatbot also refreshes. This results in users having to wait for the chatbot to reload every time they switch routes, which is not ideal. Is there a better way to e...

Hello people, I need help with a bug that has paralyzed me in teamwork for a week and a half

Guys, I need help with a bug that has paralyzed me in teamwork for a week and a half, it has me fed up. I've had this error since I tried Angular JS and my permissions went crazy or who knows what, it won't let me do npm install...
No description

NextJS REST API storing authed User per request

Hello i am looking for a good way to store the current User per request on the backend with NextJS endpoints. I saw in terminals github the usage of node:asyncs_hooks wrapped by an Actor. I like that concept, but i think i dont need to have an AsyncLocalStorage.
Are the best practices to do that? could i just use a Map / an Object instead of the AsyncLocalStorage?...

SSE

Hey, I am looking for some assistance with Realtime updates in nextjs app router. I am uploading a file in my frontend and transcribe it. All is good and well, and I get a new item added to my file list when it is complete. But now, in the background, I am generating a summary for this file using ai, and I want to update the frontend when this is done. I have tried using Server Sent Events ( SSE ), but then my revalidatePath for other functionalities no longer worked....

"Expected an error object to be thrown." At From 0 to Production - The Modern React Tutorial

Hi, I was watching Theo's "From 0 to Production - The Modern React Tutorial (RSCs, Next.js, Shadui, Drizzle, TS and more)" and at 55:35, he was implementing UploadThing to the app and I had an error at if (!user.userId) throw new UploadThingError("Unauthorized"); and I couldn't fix it. I am using VSCode's ESLint Plugin and it gave me this error....
No description

why does this procedure get called twice, once with cookies and once without

export const userRouter = createTRPCRouter({
get: publicProcedure.query(async ({ ctx }) => {
const ssid = cookies().get("sessionId")?.value;
export const userRouter = createTRPCRouter({
get: publicProcedure.query(async ({ ctx }) => {
const ssid = cookies().get("sessionId")?.value;
...

Migrating from T3 to T3 Turborepo

I have an existing T3 web app (Next, Clerk, tRPC) and I'm developing a mobile version. How can I utilize the existing tRPC endpoints and Clerk auth? I know there's a monorepo sample that Theo went over in some videos, but I'm not starting from scratch....

[Next.js Image Component] Cache Images between pages

I'm using Tanstack Query to dynamically fetch data that includes an image URL, which I then load using the <Image /> component. On a different page, I fetch new data, but the image URL is often the same as the one on the previous page. The issue is that the same image gets loaded twice. Is there a way to reuse the image across both pages to avoid reloading it?

Api directory in App vs Server?

What is the difference between these? What kind of routes are defined in each?

how do I upload file directly

how do I upload file directly from node js to upload thing

T3 Env Client QQ

Hi folks, trying to use client side env variables but I keep getting type mismatch warning. Do clientside variable need to be passed into clientside components as props?

`drizzle-kit push` connection cleanup

When I run drizzle-kit push with postgres.js I get a connection that doesn't get cleaned up. How do I run a post-push cleanup script?