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

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

BUILD TypeCheck and Lint disabled

I’ve seen Theo disabling typecheck and eslint during the build process, which greatly improves the build time. How can I apply these steps in a separate workflow? What are the equivalent npm commands for running typecheck and eslint independently as they run during the build? Will these separate commands execute the same steps as during the build process, or are there any differences?

Huge memory usage spikes with uploadthing, seeking help on how to handle it.

Hey folks! I've just added uploadthing to my project that's currently being used by a small company. We agreed to use uploadthing for very simple photo management where you can add a picture and then set a URL in a database, to later display it. My base memory usage for the app was around 15- to 170mb, it spiked to 500mb for the night where the app is completely inactive, then it spiked to around 1 GB of constant usage. The peak was at 2GB. The photos are 10MB total so it's really not much....
No description

Retry Error

Hello I have been using uploadthing for a while it was working as I desired but soon I have been uploading videos and am being told "app-index.js:32 Something went wrong. Please contact UploadThing and provide the following cause: RetryError" Any one who can help I'll be truly grateful

Hey guys, weird question but am looking for suggestions.

Hey people! I am starting in web development, and need some suggestions on what technologies I should use for my project. The project idea is a Restaurant Management Platform...

Mongo Db Schema _id(ObjectId) in trpc get serializes to string

Hello there, In the mongoDB schema there is _id field with the type of ObjectId. But during serilization from trpc on the server its get converted to a string type. On the client the Mongo DB type gives a error that the _id type is string and not ObjectId. ...

Debugging node_modules in VS Code of a Next.js app

I'm trying to set breakpoints inside an installed package, but the breakpoints are unbound, since the dependencies are bundled with webpack. I'm using the following lauch.json taken from https://nextjs.org/docs/pages/building-your-application/configuring/debugging#debugging-with-vs-code ```json {...

Bad Request 400

I really couldn't fix this problem I am sure of all the api, secret code data is correct
No description

How to setup initial db and application configs?

There's either Supabase app I created or local Postgres instance but I couldn't figure out what to use here besides not finding any documentation about it. Can anyone point me out any useful hint or a link?

Use ReactQuery to fetch different api resource than trpc resource

I have an api endpoint which I can call using fetch. How one would re-use reactquery and call that endpoint directly. Do I need separate reactquery client?
Solution:
You should already have @tanstack/react-query installed as a dependency, you can just import useQuery from it, it will use the same query client as trpc

email client

Does anyone know what an email client is ? - I have been given a task to set up an email client on Amazon ec2 - i don't have an understanding of what an email client is - I thought it is used to send emails to logged in users of our website like remainder emails like that -but the CEO told me that we have separate emails for all our employees what does that mean ...