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

Does Upload thing allow for a folder structure?

I was thinking about using upload thing to handle file uploads for my mobile app. I don’t see an option to add folders to an app. Is it possible to create folders to categorize file uploads into different types? Ie profile pictures. Sorry if this is a dumb question but not seeing it in the UI

T3 Chat - Lost all chats after deleting cookies after not being able to access the app the whole day

I am unable to get all my chats. Please check this issue...
Solution:
I guess its a network glitch, cause in the better part of the day I was getting a 401 from your cloudflare gateways and I am authenticated. Now I have gotten back access to the chats after signing out and logging in the third time (Jan 22 2025)....

[SOLVED] New to Docker, can't connect from localhost to DB on container

I am running Docker on Windows via Docker Desktop. I am trying to follow a tutorial and one of the first steps is connecting to a Postgres DB on Docker with Drizzle, but my I can't connect to it and I get an error saying the DB doesn't exist. I have this compose.yml file: ``` services:...
Solution:
you can try running this on windows to see if anything is also taking up that port. netstat -an | find "5432", cuz its possible that an existing postgres instance is already running but your docker compose just couldn't exposed it.

Keyboard shortcuts in react

Hi! What's the best way to build/organize a large number of keyboard shortcuts in a react project? i.e. Superhuman/linear # of keyboard shortcuts And would the approach change for NextJS? Thanks!...

Web Sockets on Vercel

Can I host a Web Socket server on vercel? I know you can't directly cause of it's serverless architecture but is there a work around? and if not what are the alternatives just for context I'll be using that web socket server as a signaling server to send data between 2 peers...
Solution:
Hi @.Boody You can't deploy websocket server to vercel and you wouldn't want to, based on how their pricing works. If your two peers are Servers with a public facing IP/Domain, you probably could switch to webhooks. Or if it is just one pair of peers and you're ok with not having realtime data, a pull/poll method might also a cheaper option than the following: Otherwise, have a look at Pusher.com, Ably.com, soketi.app, ParyKit. The first two provide ws as a service, the last two give a kickstart to host the ws yourself....

Do you know any way to extract a DOM-Element from a website and according style definitions/classes?

I am trying to extract an component (an password import form from auth0) from a website and I also want to extract relevant style definitions. Is there any way to do that easily? For context: I am trying to create a passwort-repeat input for auth0 using so-called partials. Partials are snippets of code you can insert in their auth-form. The password-repeat input should obviously have the same styles as the password input form but i cannot just copy the classnames because the classnames update on every update from auth0 so its functionality would be time-restricted cause it is only a matter of time when auth0 is gonna roll out another update and my class declarations are irrelevant. ...

Weird timestamp behaviour or i don't understand something..

Hi! Can you help me with an issue?
We have a countdown on this page: https://dashboard.babywhale.meme/, counting down to January 23, 17:00 UTC.
The problem is with different time zones: the time difference varies between them.
How can I implement this properly? ...

onUploadComplete and onUploadErorr callback not working

its a react + node project ``` export const uploadRouter = { imageUploader: f( {...

Typesafe: Is there any better way to write this code?

I always try to get better at coding and a challenge I recently came across is this one: I receive some values from database, give that object to a function, which calculates some additional values and adds them to the object. I am aware of two ways to do this. The first is using spread operator - which is very handy, but produces (to my understanding) potentially a huge performance impact because every input object gets copied to be spread. ```ts function calculateSums(project: InputProject)...

Making my first (production) website: Questions about auth, pricing, and hosting

For background, I’m currently studying online in college and have built several websites for my classes using HTML, CSS, and JavaScript. Until this semester, all of our projects were static sites hosted on GitHub Pages. Recently, we started learning backend development and building fully functional websites using Node.js. A local business has asked me to build a website for them. I’m using Next.js for this project, and the site needs to include: * A home page * Functionality to create and display events...

Vercel and DDOS Protection

I run this site for a YouTuber and my usage spiked and went over the free plan limit. I looked into the issue and within an hour, someone made 250k requests to my site. I have DDOS protection enabled I thought. I’m confused on how it got bypassed.
No description

Next.js Version? How to change?

What version of next.js does t3 use? I just assumed @latest meant it installed the latest version of next.js. How do I control the next.js version with t3? I read the purple docs cover-to-cover. It installed v15 in project I create today. Will it always default to the latest stable version? Or how does it decide? Can I put in a flag to change the version?

Software Engineer resources and groups

Since 2020 when I started to work from home indefinitely I started to slowly lose contact with other software engineers and I started to find myself more and more around non tech people. I have no problem with this, but lately the need to discuss different technologies with people similar to me started to become more and more accrue. Do you guys knows any groups or communities where they post latest stuff and also has a sort of forum to discuss stuff?...

How do i add custom id in uploadthing (nextjs app router)?

Hello guys, Apparently you gotta attach a header "x-ut-custom-id": "MY_CUSTOM_ID" to the presigned URL, but when using the nextjs sdk, that is unclear how to do....

T3 Slow down after 10+ messages

Is anyone else experiencing slow downs with T3 Chat after 10-12 messages? I am working on some Infrastructure as Code and about 10 questions in T3 errors/stops in the middle of a response. I can edit the question to ask it again and it will finish. Seems like T3 slows down the more questions you ask.

generateUploadButton throws type error

I'm following the 0 - Production Tutorial. I am about an hour in, and adding the upload button for UploadThing. In the first attachment you can see the code to create a custom export component using the generateUploadButton function. Calling it like this throws the error in attachment 2. If I replace OurFileRouter with FileRouter nothing changes, making me believe that OurFileRouter is not part of the problem. When I Import UploadButton from @uploadthing/react (with alias) and directly export it. As the commented out line does. The code works. Can someone give me some pointers where reality diverted from the tutorial and how to start to debug this issue?...
No description

Anyone with IoT SIM Cards and cellular connectivity experience? Need help where to look for problems

Hey all. I work in the IoT industry and our devices using KORE Super SIM cards to connect to the internet via cellular. KORE had an outage on Thursday, and only 2/3rds of our devices connected. FYI KORE Super SIM was previously Twilio Super SIM. KORE purchased that business unit in 2023 and they are still migrating. I only have experience working with the higher-level APIs available in KORE/Twilio. Stuff like activating SIMs, resetting connectivity, etc. I don't really understand the low level stuff about SIMs authorizing with a tower and such. I'm not asking for help troubleshooting that's a huge ask. But if there's anyone here that can give me a crash course on this I'd appreciate it. I at least want to be more educated and at least have a starting point for where to find a solution. I've gone 18 hours with no response from the support case with have with KORE, so kind of desperate lol....

WebGL + Canvas randomly going black [Helldive Difficulty]

TLDR: Can WebGL resources automatically be disposed by the brower/system without warning? I'm in a bit of a pickle. I have a Svelte project that acts as an image viewer and it uses an external library for rendering the images to a <canvas /> with WebGL. The user can pan, zoom, draw annotations, change brightness and contrast, etc. The problem is a small number of users are reporting an issue where the "viewer" randomly goes black and nothing they do will make the images appear again besides doing a hard refresh of the page. This isn't ideal because they lose the state of the images they had open + any effects they've done to it like changing the brightness/contrast. The big problem is this is happening silently. There are no errors or anything (that I know of) that are happening to cause this. The users are in clinical offices, so my hunch is that it is related to them leaving the website open for extended periods of time without touching the machine. I expect that their computers are going to sleep or the browser/system is cleaning up resources automatically since they aren't being used. I need help from anyone who is experienced with WebGL because I can't find any information on if this is a thing that can happen. The reason why I'm leaning towards this though is the WebGL stuff happens in "a different world" than the main thread it's the only thing that could disappear on it's own. Either way what the users are reporting is that it just goes black. It's failing silently with no errors. On my end I have no code that automatically does things on it's own. No code is messing with anything regarding the images/data array for the canvas/etc on it's own. It's only in response to user interactions. From what they are reporting it seems like there is no user interaction and that they just come back to the viewer being black....

T3 chat - document creation

Hello, on chat.openai there is a feature that when you try to create a document (a business contract for example) and chatgpt sends you to a full screen page and you can type / edit line by line the document. Is this gonna be a feature in mind for t3 chat ? PS: there is not tag for T3 Chat at the moment....