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

Help me not to give up on t3.

I've been trying to implement optimistic updates on my app but i'm getting a lot of errors. I started by following the react query docs and tried implementing it like this ```javascript...

eslint

I am failing to see a repository using the following: ```config 'plugin:@typescript-eslint/recommended-type-checked', 'plugin:@typescript-eslint/stylistic-type-checked',...

shadcn-ui components breaking

Hi, my shadcn ui components worked flawlessly when I installed them, but as soon as I installed a new components, every component broke, please help!

tRPC mutation and data

Hi, so with tRPC I'm creating an account, which I have some checks on the function to see if an account with the same email already exists. With it, I'm returning a status code and message, and the same for if a user is successfully created. However, I am having trouble with obtaining this data on the frontend. I will either get a null/undefined object, or I will get the data but it will be from the last function call, not the current one. Currently my code looks something like this: ```ts // frontend...

Third party authenticator

Hello! Im building a website for our e-sports center and I was thinking about using a third party authenticator like Clerk or Vipps. That's great as we don't need to store user data ourself, but as we are going to sell stuff, we need some form of user data to connect the purchases to the user. What is the best way to do do this? Is it just to create a user table in Postgres and only have a user_id column? Or is there a better way?

T3 or App router?

I've been playing with the App router for some time now and I really like it, however there are still some things for which I think T3 is still better... What do you all use at the moment? Which one are you going to be using forward and why?...

Get All file Url nextjs app router

hey bro how can i get all the files with their url. I want to display it on frontend. app dir. nextjs?

bug bounty - escalating HTMLi without XSS?

Hi all, Not sure if this is the right place to ask but im trying a bunch of tech servers. I've currently got a HTML Injection in a bug bounty target however their WAF+CSP is preventing me from escalating it to XSS.. regular HTMLi is out of scope so I need to demonstrate impact in some way. I can't use iframes because x-frame-options is set to 'DENY' and I'm starting to think XSS is out of the question entirely, all known event handlers are blacklisted as are a bunch of HTML tags and attributes like src= or href=, even < and > chars were blacklisted but I managed to get a WAF bypass and inject HTML chars without getting blacklisted via double-urlencoding HTML char escape sequences.. I've tried similar techniques with event handlers etc to attempt to get XSS, but no use.. plus even if I were to bypass the WAF to get XSS, they've got a solid CSP in place.. So I've given up on the idea of XSS and now im wondering if I can escalate the HTMLi some other way, so far I've attempted: - HTMLi --> CSSi --> Leaked PII...

Project Idea using T3 stack

I'm pretty new to T3, I built a todo list app using it and now I want to take it to the next step, anyone has an idea for a more advanced project to really get my hands dirty with T3? I already built an ecommerce website (not using T3, but with Nextjs), so I would want to build something else....

Astro + DrizzleORM => trouble

Im working with Drizzle ORM on Astro and im having some problems with continous "ETIMEDOUT". When using Prisma for the same project, I have no problem connecting to the MySQL. Anyone has a clue as to what this could be ? Does DrizzleORM and Astro play nice together ? Aka: will Drizzle close its connections once done ?...

Looking for a dts-bundle that is maintained

Is there a more well maintained solution than dts-bundle for just getting a single index.d.ts out of webpack? Am I doing this wrong ?:) https://github.com/TypeStrong/dts-bundle...

ChatGPT example project?

Is there a repo online that has an example project similar to https://github.com/Zoranner/chatgpt-local which is created using t3 app?

uploadthing call unsuccessful

Sometimes after pressing the upload buttion in my dropzone, UT goes into an endless retry loop as shown in the image. How can this issue be dealt with? Am I doing something wrong?...
No description

How does vercel run my code? Is my cache code working as intended?

You can use something for a long time yet not know what you're working with. I just came to a realization that something I am doing may not be correct: ```typescript type Object = { //some data };...
Solution:
I was caching the fetch data in the api route so that clients can request that data from a third party from my api. This should not be done. I used getStaticProps with revalidate to put the data into the page which means no additional request is needed. ```typescript export async function getStaticProps() { const objects = await getObjects(); ...

Nodemailer Error: read ECONNRESET

Hi, i'm using a library called 'react email' with next 12, nodemailer and an outlook email. I try to send a simple email, but get this error: "Something went wrong :/ Error: read ECONNRESET". This is my code (all sensitive info is hidden): ```...

Looking for NextAuth Discord Refresh token rotation examples. All mine have expired.

I have created a project that uses Discord as a provider. My refresh_token and access_token's have expired, I've noticed when sign in is performed, it doesn't automatically refresh these details and thus access to oauth with Discord has dropped. I am looking for an implementation that updates these details on signIn. I've found the Google example on the NextAuth (https://authjs.dev/guides/basics/refresh-token-rotation) guide but as it only includes Google and I'm not the brightest, I am looking to do Discord but do it correctly, as login is not something to mess up!...

Anybody got a vitest with T3-app setup?

I'm trying to setup vitest tests with my trpc routes, but after following the official t3 docs (https://create.t3.gg/en/usage/trpc/#sample-integration-test), and the official prisma guide on how to mock the db (https://www.prisma.io/blog/testing-series-1-8eRB5p0Y8o), I am running into the issue of (it seems like) my models not being created. TypeError: Cannot read properties of undefined (reading 'create') Does anybody have any projects that have this setup and working? Been picking my brain on this for a few hours and can't understand why my prisma mock isn't working as expected....

Routeroutputs and type inference from database

I have created a new t3-app (no changes to prisma schema or anything). When I try to use routeroutputs, I get this strange type with GetResult<{...}>. It seems to work as expected if I downgrade from the latest version of prisma. But other than that it seems like there is something I don't understand. Anyone know what this is or how to make it work normally?...

VPN recommendation

Can someone recommend a trustable and fast VPN to use? I've been getting more conscious on like the internet security recently hahaha

typewriter effect react library

can anyone recommend a react library like this https://github.com/tameemsafi/typewriterjs that has an auto typewriting effect, except that it would change the value of an input element instead of the text content of an element? the vanilla js version seems to support what I'm describing but not the react component