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

Handling Dates with client and server and database

Hello, so i am trying to create an appointment scheduling website and I am having trouble using dates between the client and the server. When I first implemented my endpoints, I made sure to convert any date I pass from the client to the server using a zod schema that converts said date to UTC for me. Then I deal with my app logic (using date-fns to handle dates) and save the date or make any db queries using this UTC date. This was working completely fine when working locally....

Single react query doesn't seem to hit then endpoint in production (Vercel)

Hi there, Thought i'd ask here as i'm at a loss I have a dashboard page with 2 queries:...

Localhost:3000 says: Failed to run middleware with uploadthing

The only way I could resolve my errors in the this file was the following: ``` import { clerkMiddleware } from '@clerk/nextjs/server'; import { NextResponse } from 'next/server'; ...

Need help picking a front end framework.

I am making a project which will have primarly many dashboards. I need help picking a framework which will work nicely with Hono which will act as my backend. Some wants are - File Based Routing...

hot reload not working on fresh install of create-t3-app

When I change some files, it seems to work, such as .env or next.config.js, but changing any react .tsx file doesn't reflect until I run npm run dev again. I am running 'npm run dev' in wsl and GETing localhost from windows, so that might be messing with file change detection, but as I said detecting the change of some files does work. No errors in the console, and I didn't change next.config.js from the default. Any ideas?...

CSS Variables or Context

We are currently using SCSS. If we are doing theming (light, dark, white labeling) of our product, should we be using React Context or CSS variables? Additionally: should our CSS variables be var(--primary-blue-500) and referencing a color value directly or should we be doing something liike var(--combobox-border-color) and reference the values all per component CSS property?...

ReactHookForm propagating nested forms despite e.stopPropagation

So I have a RHF inside a RHF, I know this isn't best practice, but this SO thread suggests it's possible: https://github.com/react-hook-form/react-hook-form/issues/1005#issuecomment-626050339 Code looks like: ```ts...

Uploadthing 400 Error

[Error] Failed to load resource: the server responded with a status of 400 (Bad Request) (uploadthing-prod-sea1.s3.us-west-2.amazonaws.com, line 0) Somehow my files doesnt upload anymore and are stuck in "Uploading State"... I didnt change anything from today morning to now and appaerenlty no user can upload any files anymore? Please help me, how can this happen??...

How to use credential login

I know there are some models from nextauth but the user model does not has like a password field. Should i just add that or is there another way? Best regards...

New Zod schema based on an existing one, with some fields having different validation rules?

Having some schema how I could re-use the schema and access some of its fields and change their validation to make up new schema. ```ts const schema = z.object({ details: z.object({...
Solution:
what happens if you define a new schema with the fields you want to edit and then use merge? https://zod.dev/?id=merge

uploadthing read operations

not so or maybe a noob question, but does uploadthing offer unlimited read operations through its API, or is there a limit? If so, what is the limit?

What kind of IT role is most likely to get you hired first:

Some kind of IT Support Technician or a Junior Software Developer? Let's say you're familiar with A+/Network+ study guide material, and have a intermediate understanding of the languages (C++, Python, Java, C#)... Given the job market in September of 2024, which is easier to get for a recent grad of InfoSec or Computer Science with 5 years of experience in Retail/Material Handling? My buddy over in the IRS as an enterprise architect believes it's software developer. What do you think, Theo's Typesafe Cult??...

Dropzone Button

Is it possible to disable the onClick functionality of the button inside of the UploadDropzone? I want to prevent the button being clicked so that I can control the callback of triggering the upload process in a different dependency. I've looked in the documentation and could not find anything about it. It seems the only way to go about this is to wrap the dropzone functionality and design it in the way I want....

How do I cancel an incomplete file upload process?

Does anyone know how to stop the processing if the upload action was triggered but the file upload process isn't complete yet (and I don't have the file ID to delete it)?

How to get accessToken from discord authentication?

I've upload what I have tried but it doesn't quite work.

Proper technology stack for ecommerce

Hi guys, Trying to figure out what framework to use for an ecommerc application that will need to scale well. I am currently between next.js and remix. What is the problem?...

Upload thing use case questions

Hi guys I had two questions about upload thing. 1. Can I use it a on a react frontend not using next js? I wan't to upload from the frontend - how presigned urls work for s3 2. How does uploadthing deal with large files? What is the largest file I can upload? how are file size limits set? ...

Does anyone have an example repo?

So I read this article, and the data-access-layer section seems pretty interesting: https://nextjs.org/blog/security-nextjs-server-components-actions#data-access-layer I still can't really wrap my head around it, so I was wondering if anyone had an example project, where I could see some more typical use-cases with this data handling model....

Not having updated cookies from middleware.ts until a page fully renders

Hi all, I'm having an issue with my middleware function, which handles refreshing auth tokens stored in cookies. here is the issue, if there access token has and have an refresh token it will request a new set of tokens...