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

Type to require elements of array to all have one property or the other

I'm looking for a type that will force all elements of the array to have 1 property or the other example ```ts...

How to handle cancelled login, when using nextAuth OAuth?

Hi there! I'm using the T3 stack for the first time and was having trouble handling the OAUTH_CALLBACK_HANDLER_ERROR when cancelling the signIn flow using OAuth. My users will signIn (e.g. via Discord) and will be greeted with the Discord login page, but if I were to cancel the OAuth flow, I am redirected to http://localhost:3000/api/auth/signin?error=Callback where I can once again sign in via Discord and I get an error in my console. The proper functionality I want is to redirect my user back to the login page. Thanks!...

Pointing to object in array giving me an undefined error in console.log

I have no clue why line 58 is giving me an error as undefined

change multiple attributes with 'group-hover'

If I want to do something like this with a component. i.e. make a tooltip go from hidden to absolute and the opacity from 0 to 100. how do I do this with group-hover?...

[Solved] Why does leetcode say “non-decreasing” and not “ascending”

Just going through leetcode questions and curious why it always say “non-decreasing” as opposed to “ascending”

T3 & Plausible proxy setup

I am having a some issues configuring plausible as a proxy on my t3-project running on Vercel. Since I am using NextJS & Vercel I want to use next-plausible and I am following the example on their gh-page. https://github.com/4lejandrito/next-plausible#proxy-the-analytics-script My next.config.mjs looks like this ```ts...

NextAuth - OneLogin flow mocking

Im trying to mock OneLogin login flow using WireMock server. I can easily get the flow working until I submit credentials on the mocked OneLogin page and after it redirects I get this error and can't get pass it the whole day ;/ ``` [next-auth][error][OAUTH_CALLBACK_ERROR] https://next-auth.js.org/errors#oauth_callback_error failed to validate JWT signature { error: RPError: failed to validate JWT signature...

Problems of using middleware

I need some router guard implementation in my nextjs app. The official answer is middleware, which runs on the server. It gives me a chance to write my logic in one place and no useless api call or render . But this brings more latency. If I want to solve this problem, I need to use edge function, which is supported by limited suppliers. My team use Google cloud function (sadly no supported edge)...

Use my next auth to allow db access to a chrome extension.

I have a chrome extension which i want to be able to access my DB, to access the info stored in their user model? So i would like to auth a user from the extension, and have them be able to get a session for api access. Any ideas how this would be done? Thanks 🙂

T3 stack with Vue, when?

Are there plans to make something like T3 but for Vue?

Job for T3 setup with i18n

is anyone could be help to fix a T3 setup with Translation (next-i18next or equivalent)?

Help with prisma nested create

I have this prisma model ``` model Membership { userId String groupId String User User @relation(fields: [userId], references: [id])...

Stack suggestion - DB platform for a larger number of smaller projects

Hey y'all, love planetscale but it's limitation on number of branches means that even if I have a very small app that has very low usage, I can't really do another on PS. Any good options for things that scale well for a larger number of smaller projects? Happy to pay for usage, doesn't need to be free, but ideally has a pay as you go sort of model.

Synchronizing TS Objects with functions attached?

I have TS Objects with functions (as part of a browser game). Is there a simple way or library to take an object, strip it of its functions, send over the data, and rebuild it into a full object with functions attached. My current best idea is to use a sort of (de-)serialization middleware between Redux/Zustand and liveblocks....

Data Fetching best practices

Wondering what sort of best practices for data fetching I should follow (especially patterns for this stack specifically)? For example, my home page has looks like pictured. Should the server state i grab on page load just grab everything i need (using CSR)? So just one big trpc call that gets me groups, user info, and everything else I might need? Should user data just rely on session data instead, and then fetch group info in isolation? Just a little confused how to move forward once the app is configured...

What was the cloud DB with SQL via HTML hype recently?

I know something was mentioned on one of Theo's streams but I can't remember.

🤔 Error validating serverEnv

I just wired up next-auth, and while trying to access my new auth routes, i get an invalid environment variables error. oddly enough when I run printenv all of the variables seem to be populated. Furthermore, when i log out the _serverEnv variable the validation seems to have passed. ...

Any good librarys for parallaxs

Looking for a good library to make parallax's easy.