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

myArr.findLast is not a function

Hi there, i have a problem with findLast in my test environment. It works properly in the browser, but when i was testing it, it cause error myArr.findLast is not a function

Writing Typesafe sql?

Advice for writing typesafe sql with some linter or something? I'm using supabase for a while now, and the only thing i don't like is writing sql without any type hint or autocomplete, there are some way of getting this right? vscode extensions or something?

Is there a way to request images from Next resized via URL without the Image component?

Question is pretty much in the title. Something like: https://example.com/img/test.png?w=500&h=500...

Copies of Database Schema In Multiple Regions (Prisma)

I want to make copies (just schema not data) of my database in different regions but have prisma search all of them (but not create). Any off-the-shelf packages that do this?

Middleware and firebase Auth

probably it is a noob question but I really didn't find any answer out there. How can i implement middleware in nextJs with firebase auth? i am using 12.2 nextJs and trying to authenticate my users in middleware before sending them to dashboard.

Default import vs member style import

I have a next js project which is in a polyrepo, it consumes a lot of member style import on next dev it compiles over 34 000 modules and makes it almost impossible to deal with. Should I convert member style import to default import or is there a way to figure out who or why it is compiling 34 000 modules it has almost nothing as dependancy (mui, firebase)

Good Beginner Frameworks

As a beginner Vue, React, Svelte, and Solid seem to stand out but I don't know the HS ecosystem so I would not know which is a good first framework. Can I get some opinions on this?

How to set a transparent background on an iframe

No matter what I do I keep ending up with a white background on this iframe. I have tried removing all the elements from it and setting background: transparent on the <html> tag. and the <iframe> itself. I tried allowTransparency but react 18 says it does not recognize this property. At this point all the google links are purple. Has anyone done this before?

TRPC Prisma using connect properly

Hi guys just created a new app with createt3, I think some things changed since the last time I used prisma and trpc, so I have following basic schema setup: ```ts model Movie { id String @id @default(cuid())...

nextAuth causes error - Module not found Can't resolve 'nextheaders'

I'm suddenly having an error on all my pages that says: ./node_modules/next-auth/next/index.js:97:6 Module not found: Can't resolve 'next/headers' Stack:...

How to deal with constantly updating data

So i have an app that fetches some data from some endpoint. Some of this data will change every 2 weeks, not all of it. One way to get the updated date would be to restart the app. Would i need to setup a cron job? setInterval? Im wondering what would be a good way to go about this. If it helps, this is relating to the game league of legends, which has patches every 2 weeks. ...

Using existing color names in tailwind config

seems like a good idea to do it this declaritive way instead of copying the underlying colors into the tailwind css... is something like this possible? how do describe it to google? what is the correct syntax? Thank you!! ```json extend: { colors: {...

Animating a Hero title

Playing with animations with vue/headlessui. Trying to create a Hero title that has a highlighted word that rotates and animates. So it would go from "I am a bilingual person" to "I am a bad person" (ignore the words, just for the sake of the demo :P) and keep rotating....

How best to implement browser feature detection?

I have a set of features, some css and some web api that have spotty support on safari, edge, and ie. Is there a standard way of targeting per browser environments or wrap unsupported features in a conditional? All i've seen is hacky css media queries hooking into a particular unsupported css feature to estimate the browser version... Is there something more foolproof or standard? ...

TRPC List Of Editable fields linked to unique database field

Using the full t3 stack, how do I have a list of inputs to display and link one of each document in a prisma query (just an array of objects)

Headless UI not working with NextJs 13 app dir

I copied just simple example from docs of Headless UI of Disclosure and without any errors it just doesn't work .

ngix bad gateway 502 error

so i deployed my nextJS app using nginx with pm2 , i have an end-point where i set headers for update the authentication cookie , in /var/log/nginx/error.log i can see this : [error] 36131#36131: *23 upstream prematurely closed connection while reading response header from upstream, client: 15> , any configuration to set ?...

Which drag and drop lib would you recommend me these days?

Hey! I saw a lot of discussions about D&D libraries, that some of them are depreciated, but still used. So that's why I'm asking which one would you recommend me?

mantime vs chakra

I need a component libary😔