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

How do Execution Context interact with Asynchronous Execution?

For a while now, I have been trying to wrap my head around the execution context. Originally I didn't think it was going to be such a rabbit hole. My question is how is an execution context that was created from a async function referencing the function that called it? is it just direct referencing the function? If so, what is happening when the referenced function finishes execution? Is it just a dangling reference at that point or is it more so a closure situation? I also didn't know if I should tag this question as noob or deep question, because I know they work when async isn't involved and I even know how they work with the eval function and in Web Workers....
Solution:
It's more of a closure situation. They call it lexical scoping or lexical environment https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures

Question about behavior of COPY in Dockerfile. An AI is gaslighting me, unsure which

In a Dockerfile does A:
COPY --from=deps /app/node_modules/ws ./node_modules/ws
COPY --from=deps /app/node_modules/ws ./node_modules/ws
produces the same behavior as this B:
COPY --from=deps /app/node_modules/ws ./node_modules/
COPY --from=deps /app/node_modules/ws ./node_modules/
...

Http cookies in next

Hi everyone! I'm trying to create a server-side component in Next.js that makes an API request and passes the data to child components. However, I'm running into an issue: The endpoint I'm making the request to is protected and requires authentication via HTTP-only cookies. When I make the request server-side, I get a 422 status code with an error saying there's no cookie. ...

GPT PLUS API KEY‼

Anyone with gpt plus api key please reply it's kinda urgent help‼️

Npm package template

Hi all, What is a modern template for creating a npm package these days In the past I’ve used tsdx but that isn’t maintained anymore...

Anyone know how a good way to work with json in python?

Looking to run a job daily off my windows that does a ton of network requests and processes data from it, and I already have a job setup with python so I was looking to do it again. If you know any libraries that makes this less of a pain in the ass, or know a better way to do this (was previously doing it on site load in js and let's just say it isn't fast https://threehoolagins.github.io/lol-team-jerseys) with the windows task scheduler? Or with a very easy to setup task scheduler

t3.chat Captcha ERROR in zen

When I use t3 chat in zen I get this error but not in chrome (it happens when logged in and when not)
Solution:
Malwarebytes block is issue
No description

nextjs and express, dev but no build?

I have a nextjs monorepo with a backend in express with trpc. I'm trying to get the first push up to amplify but I can't get the 'next build' to run property. The dev works fine and everything resolves and runs, but the next build can't figure out the trpc link. Here is my basic repo. Can anyopne tell me why the linking isn't working. It has to be something with the monorepo tsconfig setups. pnpm monorepo, trpc11, nextjs15, and express. I've been stuck for 2 weeks! https://github.com/ds...

How to fire mutation with url query param only once

I have a simple page that has a url like that: /confirm-email?token=<token-value> Now when the user visits that page I want to confirm the email with the token from the url with useMutation. ...

Proper Pagination with filtering and sorting for a datagrid questions after watching latest stream

so I saw that offset and limit have a bunch of quirks and isn't an efficient method of pagination at scale from the last stream, but this left me with a bunch other questions as well. For example you have a datagrid of some sorts that allows for sorting, paginating, and filtering. How would it look from a query params perspective in a rest api when these are complex filters?...

is any way to add item Other Recommendations?

Hi, I am creator of Tianji (https://tianji.msgbyte.com/) , can i add my project into this section? https://create.t3.gg/en/other-recs if cant, is any possible to add it with some requirement which i have not reach?...

Where the hell do you guys buy your domains

Hello brethren, I come onto you with a special request? is ti clodflare, vercel, hostinger or namecheap? what is "best"?...

Problem with trying to add more Scopes

Hi I am trying to write a website where I want to use the DiscordProvider for my login and many other things. But now I keep getting the same config error as soon as I insert the following code in my server/auth/config.ts. ```ts DiscordProvider({...

How do i fix CORS Policy block?

I'm currently making some link shortener website using php, and for some reason the client doesnt work on other website, like i want to make an api to shorten link and when i build a quick demo page to test the api, it just refuse to work even though Postman work. Please help me.
No description

Hello, could you provide me good service url for this

1. GPU providing service 2. S3 bucket service 3. Video upscale AI service (but should be possible to use API)...

Create a TS function to deep call .toString() on all Date objects without type casting?

Hi, I was working on a function which should transform any instance of a specific object (for demo lets use the Date object) to a string. I wanted its signature to be like <T>(input: T) => Stringified<T> where Stringified<T> is the exact same type except the Date instaces are now string. ```ts const withDate = {...

What are some Free Database Providers that don't go to sleep on inactivity?

What are some FREE (not cheap) tier plans from database providers you know, that don't go to sleep or scale to zero on inactivity, and don't have limited runtime hours? Need it for small tools or projects, for myself or work. Don't need much. Probably need less than 1gb, maybe even less than 500mb. But, need 24/7 runtime without it going to sleep when not in use, like Supabase does....
Solution:
I think Xata doesn't sleep, but I'm not sure

Better auth for a swift app with a hono backend - pain & suffering or a good idea?

Hi everyone, I'm not going to feign expertise - I am building my first real full application for iOS and MacOS in Swift - I am doing this in Swift with Swift UI. I have aspirations to eventually get the app to be fully cross platform, so I have opted to create the backend for the application in Hono/TS rather than lock in with with a backend as a service. After a lot of agony I think I am leaning towards better auth but do want to maybe get some feedback from the community... Is this a good call over rolling something like Supabase that has a dedicated iOS/MacOS SDK for Auth? How hard of a time will I have? Admittedly, we use Entra ID at work for sign-in and our apps just redirect to microsoft for the privilege. My auth experience is very limited, so I know for a fact I don't want to roll my own, and this seems like a better option. I just wonder how much extra work I'm signing up for by not having a dedicated Swift client....

Changing log level error

Hi, I would like to check if I want to change the log level correctly for uploadthing. I use UPLOADTHING_LOG_LEVEL=Warning set in .env file. Error I'm getting: ```bash timestamp=2025-02-26T03:43:01.987Z level=ERROR fiber=#174 message="Invalid log level" error="{...

How do I prefetch trpc serverside and then hydrate the client?

Wondering how to do this with the t3 stack. Haven’t found anything in the docs about how to prefetch on server and then hydrate the client from then on! Any hints, links or repos?