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

PUT request with tRPC

Hi everyone! First of all, I tried to find an answer to my question but I couldn’t find one. I’m trying to update an entity in my database using tRPC stack. For example, I want to edit some of my posts on my website and update their title. Everything works fine but instead of a PUT request, I see a POST request in my network tab....

can't set a cookie in my browser

this is not what I intended to do, I want to work with sessions and passportjs. but it turns out that the express-session can't set a cookie to my browser. that's why I tried this: ```js const express = require('express'); const app = express();...

Can somebody explain to me why we need an env folder with .mjs files in the T3 starter project?

Wondering why we can't use a standard .env file or .env.local or what the advantages are of doing it the ways it's done in the t3 starter?

Add props to app.tsx

how do i add props in app.tsx? i am fetching a cookie that contains colorshecme for the app and want to acess the prop in app.tsx....

Copying the Auth0 animation

I'm a complete noob when it comes to animations, but am starting to use Framer motion in a project and want to copy the animation on the Auth0 website https://auth0.com/ Any idea how to accomplish this? So far I have this, but it's not working as I thought it would: ```typescript interface TextLoopProps {...

Prisma enums in React Native app (create-t3-turbo)

Hi guys, I'm using create-t3-turbo monorepo with NextJS and React Native apps & Prisma. I do have a problem with the generated types tho, as Prisma needs node to run afaik. I have a file in @acme/db package called types.ts that exports my enums:...

How do I use import statements in worker_thread ts files?

Im getting the typical cannot use import outside of module

Astro tailwind not working

Have I missed something???

zod with post mutation stucks on a field

Hi, I finished building my form for now and on submit I can log all data properly. Now I tried to add a post mutation, so basically after clicking on submitting a post request shall be send which creates something. I also added zod for validation. ...

Frontend reading first 2 lines in large csv file

Is there a clean way to read only first 2 lines in csv file without loading whole file into memory? Users can upload big files and I want to read header column of those files

Does a react Context component with a provider only get mounted when the provider is mounted?

ie does the code inside of say FooProvider ```jsx // ./FooContext.tsx const FooContext = useContext() export const FooProvider = () => {...

rules of hooks question

Im looking at an article rn (https://kentcdodds.com/blog/how-to-use-react-context-effectively) and trying to do something similar in my context with using a custom hook that calls the useContext(). However im getting invalid hook call error, im assuming for abusing the rules of hooks.

change query params without rerender

When you useMutation with trpc, you call the endpoint with some input when you call .mutate, which is easy enough to do when you click a button or something. Is it possible to do the same with a query? useQuery takes the input and I don't see a way to change that without rerendering and calling useQuery again - eg type something in a text box and use it for a query without rerendering. I know queries and mutations are pretty much the same under the hood so the solution is to just use a mutation...

Adding Headers Breaks COR's with Next.js

Having a weird issue. I want to post to my API route cross-origin, so I added this to my next.config.js: https://vercel.com/guides/how-to-enable-cors When I make my post request from the browser like this I get a CORs error:...

How do I use less bandwith?

I'm working on a project that requires a short looping video in the hero of a project. Does anyone have any suggestions on how I could lower the usage on vercel by maybe uploading it somewhere cheaper or storing it somewhere else?

Is it safe to implement Git Repos with few users, even when they're well maintained (jotai stuff)?

I'm a Dev at a company that actually respects my input on things, and I saw a wonderful opportunity to implement Jotai. It was the perfect use case for it, and when I implemented it, every other Dev loved it (we were doing "state prop drilling" trough components, so to speak, and it was really annoying). However, my Dev Lead (whom I respect immensely) got worried about Jotai, since he never heard of it. We had a brief discussion about the git repository and his insecurities. He pointed out that the amount of users of Jotai is very small when compared to the amount of users that use Redux, for example (source: https://npmtrends.com/jotai-vs-react-redux-vs-recoil-vs-zustand)....

DB seeding

Will there be any plans to add a db seeding template to the T3 stack? Perhaps a script file that users can edit and run a db seed script to populate the database? Thanks!

Typesafe access of 'unknown' type

I'm trying to access the error variables returned by a try-catch

GCP SQL via prisma

I got a more or less empty t3-app for test I have tested on 2 databases. postgres on Railway, works perfectly fine postgres on GCP SQL on the second one prisma works fine, I can even do prisma studio and I have no problem accessing data...

Creating your own reusable components cross project (Bit.dev Storybook)

I’m rebuilding my site with the T3 stack and I’m going to be having an extremely similar site to it that I also host for premium users. These sites will share a bunch of components so I want to find a way to write my components once and reuse them. For tooling on this, the two options I’ve found are: https://bit.dev/...