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

Authorization with External API

Hi all, I'm working on a project that consists of a mobile application in React Native and a desktop application in NextJS. I was hoping to be able to share an API between these two applications, so I've built one in NestJS for this purpose. I am trying to implement auth flow into a NextJS project. Currently, I am facing an issue: When I log in - I'm able to generate an access and refresh token just fine, but once it expires, I have to refresh twice because the refresh call doesn't appear ready in time prior to the API being called from the page component, thus resulting in an unauthorized error....

SSE httpSubscriptionLink (tRCP 11 - next 14) help please :)

Hi everyone, I have turborepo with a nextjs/prisma/tRCP and I am trying to setup sse subs (based myself on tRPC doc example). Atm I have 2 subs and a Redis client based generator ``` export async function* createRedisSubscription({...

Good question for interviewing junior Frontend developer(about 0~1 year experience)

Hi everyone, as the title said what would be good question other than hoisting or closure(I know its good question but since these are well-known and probably interviewee will answer the same. I think) any ideas are welcome thank you 🙂...

T3 Env: Unconventional Setup: SvelteKit + Payload CMS

Turborepo 1. Frontend: SvelteKit - Node Adapter > build artifact in backend folder 2. Backend: Payload CMS v3 - Next.js Custom Express Server -> /admin route handled by Next.js, all other routes handled by handler.js build artifact by SvelteKit. Running backend dev (Next.js) admin - no ENV issues. It has its own .env on its root....

metadata middleware

https://docs.uploadthing.com/file-routes#middleware How to pass metadata collected from the page containing <UploadDropzone>, to be used by onUploadComplete()?...

create-t3-turbo with --turbo flag

Has anyone been able to use https://github.com/t3-oss/create-t3-turbo with the --turbo flag for the nextjs app?. I am trying to add to update the dev script with the --turbo flag but it fails to compile the packages.
No description

Error 500 when using NextJS

When I try to upload an image, It returns error 500. I've triple checked and recoded the uploadthing part of my project and everything seems alright but it still won't upload. There is no "Failed" upload in the chart on the dashboard either. There are more scripts but they are all set as default from the docs. core.ts script: ```import { auth } from "@clerk/nextjs/server";...

How to Scroll down to bottom of cli T3turbo.

The cli always seems to get stuck, then you have to scroll for ages to get to the bottom. Does anyone know how to fix this?

React native : how to handle notification actions clicks on android on background/killed states

I've been struggling with this issue for so long ( 1 week ) to handle click quick actions on notifications soo basically the situation is i receive a ( data-only ) remote message and then push a local notification and add actions to it, but when it comes to handling em in background and quit state, i click the actions nothing happens here's the code i call on my index.js
`PushNotification.configure({...

React context in Server Component Page

I have a server component page where I want to provide a context having this file and adding it to the page it throws error?? What Im missing here ```ts 'use client'; ...

How do i add custom id in uploadthing?

i was following uploadthing docs, but i cant figure out how to pass custom id via upload btn. i want to pass customId="abc" to that "imageUploader" endpoint via UploadButton. ``` import { createUploadthing, type FileRouter } from "uploadthing/next"; import { UploadThingError } from "uploadthing/server";...

Resources for typescript error handling

Looking for resources for production grade error handling in typescript. I often find myself not caring about errors and want to change this bad habit of mine. Please leave resources, tips and tricks. Thank you!...

From Post to API

Is it possible to post a from to an API Endpoint but stay on the Page without JS ? I have a project that requires me to use JSP (without JS). And I want to add data to a list, and keep that list in view....

Types not matching up when exporting AppType for Hono???

So when I hover my AppType in the api i get a proper output that seems fine (image attached) But when i import it in my expo app, however the AppType it doesn't have the output type not sure why? (image also attached) Check out the repo: https://github.com/jacobsamo/BuzzTrip/tree/mobile When i check out other implementations that seem to work e.g https://github.com/w3cj/hono-open-api-starter and types all work so not sure what i am doing wrong....
No description

T3 + Mongodb + Docker

I'm trying to get a T3 app (trpc, tailwind, prisma, mongodb) running for local development using docker-compose and a different compose file for production deployment. Mongo needs to run as a replicaSet to work with prisma transactions. I find bits and pieces of old blogs and yt videos but nothing solid. Anyone know of a good guide for this? I can't possibly be the only one on the planet trying to do this....

Zustand question in next js

i have this code ```ts export const useTaskStore = create<State & Actions>()( persist( set => ({...

Use eslint-plugin-react-compiler with the new ESLint flat config

Is it possible? Does the plugin support ESLint 9 and above? If it is possible how can I use it? The example only shows the way to use it with ESLint 8 and below (no flat config)...

Help Needed: Jest Fails to Transform UI Package After Migrating from CRA to Vite in Monorepo

Hi everyone, My name is Yotav, and I'm working on migrating my company's Create React App (CRA) to Vite. We have a large application that we've built over the last 7 years, and it's organized in a monorepo structure. The app uses a custom UI package we've developed, and we use Jest for testing. After starting the migration to Vite and making the necessary adjustments, I managed to get most things working. However, I'm encountering an issue where Jest stops transforming the UI package when running tests in the app. It breaks when it encounters the export keyword. I've tried various solutions found online, but none have resolved the issue. I'm hoping someone here can help. ...

Monorepo module resolution issue

Hi everyone, I'm facing an issue with a Next.js application in a pnpm monorepo workspace and would appreciate any help. It's probably just some config issue from my side, but I've been pulling my hair out over this the last few days! I have a monorepo using pnpm with two packages:...

Is storing flags/config as a single jsonb row in a postgres table a reasonable thing to do

I know there are better ways to implement this, but this one was the simplest to write a ui to edit them I'm just displaying formatted json in a monacco editor and parsing and storing it in that column. Aside from potential performance issues, which I don't think will affect us for a good while, are there any other downsides to this approach?...
No description