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

react native windows - Is someone using react to build windows native apps?

Is someone using react to build windows native apps with something like "react-native-windows"? Is it good?

typescript object util library

Is there any good typescript library for object manipulation? Ie changing values of deeply nested objects, getting values via dot notation keys. Setting via dot notation etc

Best image service provider

So i want to store and serve images for a personal maps projects for an alternative to Google My Maps, i want to store images of places in a bucket of sorts and would perfer to not pay as i don't plan for it scale any large than myself and a small group of people. Any recommendations? i will be storing quite a large amount of photos as each marker on the map will probably have 3 - 15 images depending on the place. Solutions i have had a small look into: ...

Use Zod schema after parse & transform as a new schema

I am looking how I could handle from validation with one schema so it can be used on the ReactHookForm zod resolver and tRPC input validation. lets say my form accepts two values ```ts const schema = z.object({...

NextAuth v4 auth timing out when deployed to Vercel, but works locally

I've been having an issue the past 4 hours trying to figure out why exactly my app works locally with Discord OAuth, but when deploying to vercel, it times out. It seems like im getting a 200 when hitting discords authorize API: https://discord.com/api/v9/oauth2/authorize...

using gRPC with tRPC

I’m trying to make an api call to a third party api using gRPC (i generated protos for the api & then use grpc-js) inside a tRPC procedure (so approuter -> someprocedure), however I get the error that the underlying node http module is not found, indicating that perhaps it’s running on the browser side, which makes me think that I do not fully understand tRPC.. A simple example that replicates this issue here: https://github.com/trpc/trpc/discussions/5971...

Send upload video link to the client before or after upload to upload thing?

I'm building a LLM/image/video centralized tool (tryblend.ai) and was wondering about the best way to upload/return url to client. Let's say I generate a stable video using Falai and get the URL from them. Currently, right after the generation, I upload it and then return to the client the URL from UploadThings. Should I instead return the Falai URL to the client, display it to the URL, call the server function to save the URL, and when done, replace the URL the user sees? What's the best way of doing it here?...

"Error: Text content does not match server-rendered HTML"

I'm using the T3 template with Tailwind and tRPC. I'm not sure what I might've changed but it's still using the prefetch pattern with <HydrateClient> in the main server component and useSuspenseQuery() in the nested client component. My code is identical to the template with the exception of some extra form fields and a list. While the data is loading in (a list of db entries) - an old set of data flashes in briefly. I'm assuming this is cached data and the rendered difference between that cached data and the new data is causing the error. Assuming I just need to set no-cache somewhere, not sure how to do this with tRPC....

tailwind ui library or do I build myself?

Coming from svelte, I love using Tailwind, and honestly, I'd like to keep it that way. Now - I'd like to work on a project in react (probably t3/next, idk) but idk which ui library to choose. Do I build my own? Do I use, idk, DaisyUI, so something unrelated to react? imo the list of tailwind react libraries is quite lacking compared to my expectations. There's NextUI, shad (which i don't like cuz I don't wanna store their component :p), aaaaaaaand.. thats it for react specific ones I think? idek

UTApi getFileUrls 400

I'm getting a 400 error when trying to use this function. I swapped and tested the deleteFiles function within same code structure and it works. I'm currently on the free plan building out an MVP... is this because I'm not upgraded or I suck at code and need to troubleshoot? lol. Thanks in advance for any assistance, greatly appreciated....

need help in css

I want to build a responsive website, i know it can be achieved by the media queries and fluid layout but i don't know the best practices to do. I have the basic or say prior knowledge of the css. I need help (i.e doc or anything which is helpful🙂) 🫡

Send help, I have choice paralysis.

This isn't my usual line of tinkering but I need a framework, or at least a starting point. I'd really like to learn and I can't think of a better place to ask. I do Discord and Twitch bot development, and one of my projects collects game-related data from another bot (think fantasy sports for retro games) with the goal of putting it into a nice overview for all the various aspects of the game. Everything's stable and working great except for the overview part, but web development absolutely is not in my usual wheelhouse and I'd like to be able to give the other guy in the project something to build off of since he's struggling to get anything off the ground... as well as myself for other projects which would love a UI. I know there's no perfect answer but I'd love to get some input from people actually doing web development. Just need a solid starting point and the millions of listicles clogging up search results aren't helping....

Developing for multiple platforms.

Have you folks found any significant drawbacks of building even pure web apps (sometimes full stack sometimes not) with the same technologies/stack you would use for building a full stack universal app? Also would be interesting to hear what stacks you folks would opt for if you were building a full stack web + mobile project with the same functionality on both platforms. Background:...

Unexpected useQuery behavior

I am using the t3 stack on a personal project. I have a client component that calls a useQuery hook from from ~trpc/react . I can see in my server logs that the procedure that is called from this use of useQuery is getting called on some interval. Is this default behavior? Can I configure this somewhere? Thanks in advance....

UT middleware with authentication and fileOverrides

I am trying to have a middleware in one of my upload routes where I authenticate a user and I want to add a customId to the upload. I can do one or the other but when I try to do both in the same middleware function I get a 500 error. This is the code snippet, in this case user logs a correct object but then throws a 500 server error. export const ourFileRouter = { // Define as many FileRoutes as you like, each with a unique routeSlug...

Convert to webp before upload

I am building an admin page where I can update images and I don't want my client to upload no other image format than webp. I know how to convert images to webp and I have the utility function. How do I intercept the file being uploaded and convert it to webp before uploading? Also, how would I deal with a scenario where multiple images are uploaded ?

I'm done, really need to learn how to develop.

Hey everyone, I could use some help and guidance. I'm a computer science student with a background in C++, Rust, and Python, mainly focused on cybersecurity. However, I've realized I need to broaden my skills and learn modern web/app development. I've tried my hand at Python's Django framework and Rust's egui library, but struggled to grasp the concepts of actual development. Despite these attempts, I feel like I'm missing the fundamentals of building real-world applications. After hearing about TypeScript, I've decided to give it a shot and learn development in a more conventional way....

App crashes when TRPC error is thrown on the server

I've found an interesting situation while using TRPc with the T3 template on the server. If the Authentication middleware for the TRPC procedures throws an UNAUTHORIZED error if calling it on the server: ```ts import { api } from "~/trpc/server"; ...

why is `react-responsive` not updating darkmode consistently

I'm using react-responsive to make my PrismJS syntax highlighting (used by react-code-block here) switch themes depending on whether the system is in dark mode or not. However, for some reason, whenever I reload the page with dark mode enabled, dark mode isn't set and thus the app defaults to the light mode theme. Attached are screenshots showing the difference. Below is the relevant code: ```tsx...
No description