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

Deployment Errors on Vercel related to Tanstack NPM Packages

Does anybody have any experience resolving these types of errors? Not sure what to do and can't find anything online related.... Thanks!...

Bad Idea? Detect mobile with UserAgent Next.js

I have a component that I am showing/hiding with mediaqueries like this ``` const [selectedPlan, setSelectedPlan] = useState<PricingGridPlanType>('hobby'); <div className="hidden lg:block">...

VSCode autocomplete fix?

Hey guys, does anyone of you know how to disable the unrelated suggestions in VSCode?

bot hosting

I want to host my discord bot written in python. I want to find a free hosting service which provides server without cards, or phone number, free, no GitHub link required and shall be having nice uptime. Good specs are NOT required. i am ok even with 15mbps connection, 800mhz 1 core cpu, 100mb ram. More than this is also accepted but not needed

How does Spotify keep the player component running on route changes?

No matter where you navigate in the app, the music keeps playing. In my own app, which so far was able to handle vidoes - I route to /video/... where I have a player component that uses the the Plyr package (https://github.com/chintan9/plyr-react) I can use it to play audio files as well, but when it comes to audio - I have a BottomPlayer component that should keep playing in many different routes while floating at the bottom....

T3 Stack SQLite to MongoDB

How should I go about switching to an existing mongodb db from the create-t3-app template?

Which forum along with create-t3-app?

Hi everyone, I am building a website, centered around a niche community, using the create-t3-turbo stack, and I am looking for suggestions on which forum software to use. I am considering options like Discourse, NodeBB, and Flarum, but I am open to other suggestions as well. Discourse has an API, so in theory one could build a frontend for it in NextJS, but I'm not sure the developer experience, nor the final product would be worth it. But I am put off by the idea of using plain Discourse, as I might have to learn EmberJS and Ruby on Rails. I am interested in hearing about your experiences with these or other forums, and any concerns or challenges you have faced when using them with a Next.js application. Thank you in advance for your input and advice....

Anyone can share their package.json for deploying prisma to vercel?

I'm looking at this tutorial https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-vercel#vercel-build-hook and it says to use vercel-build instead build My goal is to apply migration whenever i push to github and vercel (both for staging and production)...

vercel error

npm run build works just fine but when pushed to vercel, this error shows: Error: Loading initial props cancelled

vercel dynamically use the created url as host

I'm trying to preview my app before deploying to prod on Vercel. I need an APP_URL which is just the domain of my app. How do I use the one Vercel generated for me as the env variable?

Zod validation for datetime

Hello! I am trying to follow this doc: https://zod.dev/?id=datetime-validation It is giving me an error for whatever reason. Has anyone tried this validation?...

Why won't my React app send HTTP-only cookies in WebSocket upgrade requests in production?

Hi everyone, first post here - I'm currently building a full-stack TypeScript chat app with React + Vite on the frontend and Node on the backend. I have two separate servers running: one is a REST API and OAuth2 auth server built with Express and Passport.js and the other one is a WebSockets server built with the ws package. They run independently (no interprocess communication whatsoever) and use stateless auth in the form of JWTs. Here's how my current flow works: users first log in with either their Google or GitHub account, and once the first server has verified their identity, it sends an HTTP-only cookie down to the client. This cookie is send back to the server on all subsequent requests and I have some middleware that runs on the REST API to parse and verify the JWTs on protected routes. Once it has the cookie, the client then initiates a WS connection with the second server, which also checks for the JWT cookie in the incoming HTTP Upgrade request and verifies its signature before allowing the new client to continue exchanging messages. Both servers and the React frontend app run on different URLs, both on local dev and prod, so all requests are cross-origin, but CORS is enabled on the REST API/auth server and as far as I know the WebSockets protocol doesn't implement any CORS policies......

Multiple DB Connections and Prisma clients

I have 2 databases that are handling different elements of my platform; because of the limitations of Prisma for multi-tenant connection, I need to have multiple clients. At the same time, using the output property does't resolve correctly in my Turborepo setup, so it makes it difficult to do so. I'm getting some conflicts between the clients, and had to ultimately take one of my clients out of the packages, and move it side-by-side with the app that uses it most. It's just inefficient; anyo...

Getting dupilcate data from table pagination

Hi, I am currently working on paginating a table with data from a database using prisma and trpc. But there is one record that keeps being displayed as the last element and I am not sure why it is happening. The record being shown is always at the bottom with the name Jan Bogan which can be seen in the screen shots...

Is it a bad idea to choose to use mongodb with Prisma on the t3 stack?

Basically, there's an already setup mongodb in a project, I could push to use a relational db but for now it will only be used for users so Id probably live with mongo for now. I've read some stuff here that Prisma doesn't work well with mongo, does anyone know its issues ?...

Prisma npx db push on vercel --prod

How do I populate the tables for my production database when I push to vercel the first time? Do I have to do it manually?

Image url from s3 as next page

How can I create a proxy page component so to say to view my files from my s3 bucket inside my webapp, so I don't need to open the files using the s3 url. So I would pass the presigned url from my backend to my component page I guess, which I already created inside ```ts...

Typescript const to functions component type.

How to convert this const to function in typescript const Home: NextPage = () => { return <>...</> } to ...

tRPC and Vercel Serverless Functions?

When using tRPC on Vercel, will all trpc enpoints be serverless functions? Or it will be count like only one serverless function?