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

pnpm/turbo workspace issue

I have the following workspace setup: ``` packages: - apps/* - packages/*...

How to manage state in a vanilla js app in a functional programming way

This question has been bugging me this week I would love to have some suggestions on this topic.

React To Next header cookies/Token

Hi, for some context. The backend is in python frontend in react and the auth system works by going Frontend clicks a link and gets redirected to the backend -> backend redirects to discord -> discord to frontend and the session token gets saved on the frontend. by using credentials: "include" in axios the backend retrieves the session token in any call I make to the backend. is there a more optimal way of doing this? (don't suggest next-auth cuz its bad)...

"Weird" characters are visible in VSCode Git Bash terminal output (like this: `←[90m` )

Hello, fellow theoists! I'm watching a new video from Theo, and have an issue after running pnpm db:push command inside VSCode "Git Bash" terminal, in Windows 10. I see some "weird" characters inside of my console. The issue does not exist in Command Prompt terminal. I think the problem related to how git bash is interpreting something from this list: - [ ] ASCII escape characters...

Next Auth Drizzle Adapter does not include extra columns (fields)

auth.ts ```ts providers: [ GoogleProvider({...
Solution:

useUploadthing hook is slow

Hi, I recently started using Uploadthing. My use case involves attaching images to messages in my chat component. I want to ensure that images/files are only uploaded to Uploadthing when the user actually sends the message. To achieve this, I call "startUpload" from the "useUploadthing" hook when the user clicks "Send." However, the upload process is slow, typically taking about 8 seconds for a 200 KB image. In contrast, when I use the predefined UploadButton, the upload is almost instant. Is there an explanation for this discrepancy? I have tested this in a blank project to ensure that the issue isn't related to my project but the upload from hook is still slow. There are no extensive computations or other operations that might slow down the upload request. Any feedback would be useful. Thank you...

Caching getSignedUrl without DB?

In my tRPC using app, I store image files on Cloudflare R2. The client browse these images by listing them over a query method, that generates a signed url for each with getSignedUrl. However for each request the client makes, these signed URL change all the time, making the browser really overfetch these resources. My idea was storing these signed URLs in the db, but I don't like the extra latency the DB reads would introduce. Making getSignedUrl deterministic would be a much cleaner solut...

Vercel and Cloudflare DDoS protection

Hello! I have a question, If I host my site on vercel and put static files on the site like logo or my resume and I use Cloudflares DDoS protection with my own domain that should protect me from getting banged the 10+k$ fine for someone dosing my site via these files?...

SystemError [ERR_TTY_INIT_FAILED]: TTY initialization failed: uv_tty_init returned EINVAL (invalid a

I cloned create t3 app locally, then I tried to run it locally by first running pnpm install then pnpm dev:cli but I got an error (as shown in the attached image)...

Animating a background moving between grid elements

I made this simple switch but I wanna animate the background moving from left to right instead of having it disappear and reappear. Right now the background is just a css class applied when the item is active, but I was thinking of creating a grid item that overlaps the other two with the same width to achieve this. Couldn't get it working though, any tips on how I can do this? This is my current component ```html...

Is Theo's new tutorial any good for a Vue Dev?

Truth be told I have never touched React or any .tsx before. However I have been doing vue for the last 5 years or so. So yeah should I look into other things first or just jump in the deep end with the video?...
Solution:
If you know enough Javascript, look into react.dev to learn the basic hooks and get to know that "mental model". In less than two days, you should be ready for Theo's tutorial IMO...

Email exist verification

does anyone knows a way to verify if an email exists? like is there such a package or services with API provided? lots of package i found but not really being maintained anymore since years ago 🙏

Issues with Clerk and Unit testing

I am working on a project for work and we have a strict requirement for unit tests. I decided to go with Vitest and we're using Clerk for auth. I ran into two different issues and I'm not sure which path is easier to solve. When I run the test (one so far) using the render method from @testing-library/react I get an error that "AuthContext not found". That made sense so I used a pattern I've used elsewhere of making a wrapper for render that wraps all children in a ClerkProvider. When I do that I get a new error that says ClerkProvider.js 2 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "@clerk/nextjs" asking them to ship the file in .mjs extension or add "type": "module" in their package.json. I'm unsure how to proceed as the only issue I currently have with Clerk is that they have zero guidance on how to set up any tests within the auth context. Hoping someone has encountered this and has a pointer towards a solve....
Solution:
SOLVED: After talking with Clerk it seems that two things were necessary. I needed to use the require syntax to import the Clerk provider in my wrapper, and I needed to pull in the AppRouterContext as well.

Drizzle + SQLite updated at field

Is the only way to have an updated at field in SQLite just setting the updated at by hand on each update? And if so what is the best solution for it in Drizzle? Can you just set
sql`CURRENT_TIMESTAMP`
sql`CURRENT_TIMESTAMP`
as a value?

How can I replicate the vanilla behavior of NextJS API routing in T3 stack?

I am currently working on a project in which i would like to have my server side requests to an endpoint that is not on my local host using axios and REST. Currently, I am placing my server side requests to the endpoint at src/pages/api/locations/route.ts, and the client side consumer at src/pages/fakerequest/index.tsx. The problem I am facing is a 404 when the client tries to fetch data from my serverside request, I tried consuming this on Postman but i get the same 404 error. I have read the documentation regarding project structure but I don't understand this particular issue considering my authentication routing works, i hope someone can help me with this please! Here is the relevant code: https://share.riseup.net/#e6cDhcMxsvDXt6ACyhO0Sg...

this works but nope?

I'm new to Suspense, this works great but I get the error: Did you forget to use 'await'? It works, it shows the loading state when I press the button but I get this error, any clue? If I add the async await it won't show the loading state....
No description

Micro Front End best practices

Hello! I recently landed a job within a stack centered around micro front ends (react + node), which is a new realm for me. I've observed some user feedback regarding performance concerns. If you have any experiences, best practices, or references related to this architecture, I would be extremely grateful for your insights. Thank you very much!

Using Turso in T3-Create

Hi, I am trying to use Turso for T3. I am using drizzle. The connection .env is slightly different than expected, however, my quick tinkering failed to work. Any tips?...

No file route found for slug in deployment

This issue arose when I started my deployment on Render , which simply read as No file route found for slug messageFile The upload page worked fine in development which say it simulated a callback . The upload dropzone does upload files to uploadthing server , but stuck at loading like in the screenshot . ...
No description