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

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....

Cacheing Astro SSR pages at build tine

Hey all im making a site with SanityCMS and astro, currently im using SSR on all my routes and using FastlyCDN to cache the pages. These caches get invalidated by a webhook whenever an editor updates a page so content stays fresh without the need to rebuild. This is nearly perfect for me, but i wish there was a way to have my pages cache after the build, rather than when someone visits the page. Thinking about it now, i could probably run a post build script which tells Fastly to recache a list of slugs. Ill check their API....

how to get a refund? i wanted to use it for claude but this AI cant even read pdfs :(

how to get a refund? i wanted to use it for claude but this AI cant even read pdfs 😦

How to remove unused teams?

I created a new Team on dashboard and having issue figuring out how to remove it. :> P.s. Google and Docs didn't help much 😛 P.s.s Thanks...
No description

Supabase Postgresql Timeout on Discord Auth Request

Hey there! I'm trying to build my first T3 app and trying to get the auth up and running. I have it connecting to the Supabase PostgreSQL database and am able to connect & push updates to it from the console, but it's timing out on the Discord OAuth authorize call with an "AdapterError" and "write CONNECT_TIMEOUT". I think everything should be configured correctly (Discord redirects, supabase), but I can't figure out what's wrong with the configuration and why the write isn't working. Anyone have any idea of what I'm doing wrong? This is some of what I see in the terminal console: [auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror...
Solution:
Problem solved! The main issue was that I wasn't using the correct Supabase URI! I needed to use the Transaction Pooler address rather than the Direct Connection address.

Supporting multiple auth providers

This is more so a high level backend question, but I am wondering what is the expected behavior if I want to allow users to sign in to my app via Google, Discord, GitHub, and even just plain ole credentials (email + password). Should I create a separate account for each provider that the user logs in with (regardless of the email), or should I do some sort of auto account linking where I would merge multiple providers into the same account if the email is the same? Unsure if that would impose account hijacking issue or any other security issues. Another potential edge case is that if I were to do account linking, say with Google and credentials, and the user changes their Google email, should I still honor the linkings because it's still the same Google account?...

I'm lost and I don't know what should be my next steps

I've been learning web dev for a year now I started exactly 1 years ago. I've learned a lot thankfully and at the beginning I was really lost just like I'm now. but the difference is I thought I was alone and I had to figure out everything on my own but now I recognize that communities like this one exists and I can ask for help. anyways as I mentioned I've learned a lot about web dev the past year especially front end up to being comfortable using nextjs to build any app that has a crud and auth in it. back to the main point which is I'm currently lost I've tried to build something slightly advanced I guess like a zoom clone has has meetings and stuff but I couldn't I got overwhelmed by WebRTC and Web sockets which I wasn't exposed to before this project and when I look at someone like theo and the stuff he's building like t3 chat or sth I really get inspired like how is he like that I wanna be like him I think he's really cool but I just don't know how to get there....

HTMX worth it? or bad?

I enjoy the idea of it, but is it any good? Has anyone used it? What's the pro and con of using HTMX? I'm a vanilla dev 😁...

Whats the name of the web scraper api that sponsors theo?

I've been looking for a while now, I can't remember the video or name of the company. If you know, I'd appreciate the link.

T3 Chat state

I'm building an AI chat application where LLM responses are streamed to the frontend using web sockets. The frontend concatenates these responses to the existing AI message using React's useState. However, I’ve encountered an issue with faster responses. The LLM can stream up to 25+ tokens once, but the frontend is unable to update the state multiple times in one go. As a result, only the last token is concatenated, and earlier tokens are missed. I've explored two potential solutions, but neither feels optimal:...

Astro Document Processor

How can I add a document Processor to Astro, to add Supported Formats ? I want to make my Docs with starling and I have XML comments that I want to include as an API overview. It would be nice if that already exists, but I'm totally fine writing it myself if anyone has any resources on how to add it....

Sentry Alternatives

Hi everyone, I was wondering if anyone has experience with alternatives to Sentry and had any thoughts they could share. I am not particularly unhappy with Sentry, just also curious to know if there is a better solution out there....

atomic distributed transaction

I have a nextjs action function which does 4 different tasks, 3 of them are making an api call and 1 is updating the database using prisma. I want to create these 4 tasks as an atomic task. I came across SAGA patterns. Distributed workflow orchistrators like okres. I wanted help on how do i implement it. + also i want to make the nextjs action for these task to be asynchronous with nextjs using RabbitMQ.
No description

Is it safe to ignore occasional next-auth CLIENT_FETCH_ERROR reports if everything seems fine?

I'm running t3 app with ~100 users on vercel using Next-auth, and I'm getting these errors in sentry. I'm fairly certain these are happening because of network issues on the client that I really don't have any control over, but I'm not sure how to ensure that's the case? Is there a way I can configure next-auth to handle these more gracefully? Error message: [next-auth][error][CLIENT_FETCH_ERROR] ...

Error [LibsqlError]: URL_SCHEME_NOT_SUPPORTED: The client that uses Web standard APIs supports only

I am getting this error when my project have middleware. Error goes away when deleting middleware.ts
LibsqlError: URL_SCHEME_NOT_SUPPORTED: The client that uses Web standard APIs supports only "libsql:", "wss:", "ws:", "https:" and "http:" URLs, got "file:". For more information, please read https://github.com/libsql/libsql-client-ts#supported-urls
LibsqlError: URL_SCHEME_NOT_SUPPORTED: The client that uses Web standard APIs supports only "libsql:", "wss:", "ws:", "https:" and "http:" URLs, got "file:". For more information, please read https://github.com/libsql/libsql-client-ts#supported-urls
...

Tanstack - React tabel , pagination problem

Hey guys, i hope y all doing good. 😃 I m using a Tantstack tabel in order to display some fetched data in column which includes some actions for each row , 🔴 but every single time a user updates a specific row the pagination jumps to the first page (which is the current problem ) , could you let me know how fix this pls ?...

onUploadComplete is not being called

I followed the instructions from the documentaton. When i upload something the file is uploaded well but the onUploadComplete is not called and the loading animatiopn does not be removed from button. What am i missing? Can anyone help me?

Looking For Specific Theo Videos.

Good day everyone. I have a quick question. Does anyone know of the titles, or have a link to the following videos that theo has done: 1). The video were he was talking about "sending unresolved promises from the server to the client" ., 2) Talking about some of the internals of react-native, from what i recall how react-native uses the same type definitions for the dom as react (something along the lines of that), he goes into detail about react-native & 3). The Theo-Primeagen debate about typ...

hosting videos in Vercel static CDN?

I have a video I want to host but don't feel like setting up AWS cloudfront etc. Is it a bad idea to put a couple short videos (20mb) in my website's \public folder and use the Vercel CDN to host the videos for me so that I can embed them in other places?