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 i take logs & analysis about how my web application is performing.

I am new to logging and analysis of applications. I have created an application with 3 backends which communicate to each other using http api. There are a lot of activities going on in the application. How do i know what i need to log , where to store and how to analyze and how do i get notified if something is wrong. I came across open telemetry but i have not read about it.

Playwright page.goto in next js

Has anyone here worked on playwright with next js? What is the reccomended aproach for waiting for the page to load with server components? I was thinking of using network idle but it is apperantly discouraged. Maybe next js signals if it is loading with some aria attribute? Idk, help would be welcomed...

module not found error

I am getting module not found error after i tried to implement a login function.
No description

Looking for some schedule components libs

Hi everyone, hope you are all alright ! I have to make a schedule component in React with 2 types of view: - By week - By Day ...
No description

Cookies and sessions on Express.js, I am unable to understand how this works..

... well I sort of get it, but here is my code ```js import express from "express"; import cookieParser from "cookie-parser"; import session from "express-session";...

Payload to large trpc

Where do I adjust the max payload size for trpc?

Sorting Tailwind classes without `prettier-plugin-tailwindcss`

I was wondering if there is any public function or library that is able to take a string or Array<string> of classes and apply the same or similar method used by the plugin. My use case is for a custom class merger I built. The issue is that the result can't be accessed by the plugin for obvious reasons. I thought I could import whatever functions the plugin uses internally and piggyback off that, but they aren't exposed by the package. Are there any alternatives or workarounds I could use? It's not a big deal at the moment, but it makes me uncomfortable not having all classes sorted....

Credentials login error

I am trying to add Credentials login. I am putting the code and the error I am getting.
No description

I'm wondering how you can advertise CodeRabbit when it is so clearly a security vulnerability

https://discord.com/channels/1134356397673414807/1326543518612852776 Please see the above discussion. CodeRabbit requires write permissions to your code on GitHub. This seems a bit crazy....

Getting build errors after upgrading to nextjs 15 and react 19

I have just gone and updated my project to nextjs 15 and react 19 and have almost fixed all my issues with the upgrade however i am still running into 1 issue that stops me from building. and i'm not sure why as it gets caused on the /404, /_error and /500 pages. ```bash [Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.] Error occurred prerendering page "/404". Read more: https://nextjs.org/docs/messages/prerender-error Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings....

UploadThing Progress for each file

I am just wondering if there's a way to get the progress of each file being uploaded ?

React Query frequent cache updates

Hey everyone, I’m working on a React chat app and using React Query for data. Basically, I fetch the conversations list and messages from two separate APIs at first, but after that, all interactions (like new messages, unread counts, etc.) are handled through WebSockets (inbound and outbound). Right now, I’m using setQueryData to update the React Query cache whenever a WebSocket event happens so the UI updates immediately (like appending messages or updating the last message in a conversation). It works, but I’m wondering if this is the best approach? It feels like it might get slow or messy with a lot of updates. Is there a better way to handle frequent WebSocket updates with React Query?...

Anyone familiar with using webassembly for a python library with react?

I wanted to use the microsoft/markitdown (https://github.com/microsoft/markitdown) python library in a web app to convert files to markdown, but couldn’t find any leads as to how to compile the python deps some of which depend on C to web assembly If anyone has any experience with this and any tips on deploying this webassembly stuff on vercel, please share your findings Thanks...

error when deploy next js full stack to vercel

error when deploy next js full stack to vercel Hello I'm facing an issue when i make a fullstack application with next js when you use getServerSession() from NextAuth in server component...

Jose DataError: HMAC key data must not be empty

Hey y'all. Working on adding my own auth flow to my Next/T3 app using a magic link/email. The link takes you to /api/sign/<your auth token> where Jose signs a JWT and I attach it to a cookie. It had been working fine before, but suddenly it's throwing a DataError: HMAC key data must not be empty error. I did some Googling, came across only one instance where someone had this issue on GitHub (https://github.com/panva/jose/issues/698) but wasn't helping at all. ...

Reuse tRPC client context in a turborepo structure

I am using a turbo monorepo with tRPC and some nextjs apps. I want to create component and hooks packages that uses the app's own trpc client without having to define it all over again inside each package. I was thinking that i could use the client provider to give me the right client inside the components and hooks, but it does not seems to be obvious how to hook on the trpc client's context to do so. Is this the correct thought or there's a more elegant solution to this problem?

Nuqs slower than useStste

Hi, today I started replacing a useState controlling the state of a dialog with a useQueryState of nuqs and it feels way slower now. Any ideas why it is like that? Is that normal? It makes the app feel way slower and kinda makes me overthink if it really is a good idea to put the state in the URL.

Architecting a task queue

Heyo! So me and some university buddies want to host an LLM prompt engineering event where people try to steal or prevent the theft of the password in the hidden system prompt. "The vision" is to have everyone's user prompts go up against everyone's system prompts and have everyone iterate to get better and better prompts. To boil this down, after some person submits a new system prompt, the system should queue up LLM tasks to run that system prompt against other people's user prompts. Same thing but vice versa for any new user prompts. Of course, it should drop any queued tasks that don't have the latest prompts. We're planning on architecting this using three parts: ...
Solution:
Just to wrap this thread up in case someone comes across it in the future, I ended up choosing this: tldr: No queues and a postgres DB as the glue - just dump user and system prompts into a postgres database from the frontend and keep track of the latest of each prompt for that user...

avoid auto scrolling when intercepting routes

anybody knows a solution for this? scroll={false} won't work for everybody https://github.com/vercel/next.js/discussions/48445...