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

tRPC complaining about unsafe assignment of any on mutation

Not sure what's causing this, anyone know why it would be complaining about the any type?

Prisma creating data twice

i want to check the db for a video with same id. if it exists dont post if it doesnt create a new video

Logic for breadcrumbs

I’ve created a general breadcrumbs component but wasn’t sure if each page that requires it should manually specify each breadcrumb. Seems annoying (but not that much work). Is there any way to do this in a less manual approach or am I overthinking this lol?

Image upload using prisma + trps

I am working on a project which involves uploading images using trpc and prisma,. In case you have done it before, plz link up your repo and I'll try to figure how you did it. Tried a little bit of googling, but didnt get it well

how do you change the parent branch in git?

Here is my current git graph: ```bash main c1c2c3c4c5 | branchA |c1c2c3__c4...

is refetching every second a bad idea?

I am creating an auction app,users fire mutation on click that writes current bid in db but in order to synchronize changes on every client I have set the query that gets that data on refetchinterval 1000,expected use case is about 50 users for around 1 hour,should I maybe do that some other way ?

_app.tsx file for other folders

I would like to implement layout-based routing in my pages directory. However, since I am using the "pages" directory in Next.js, I am looking for a way to use something similar to the "_app.tsx" file, but only for the files inside a specific folder. This would function similarly to the Remix routing style, where there is a folder, such as "panel," and a file called "__panel.tsx" that wraps the files inside the "panel" folder with a layout. How can I achieve something similar in the Next.js "pag...

Local Database for Vercel hosted api functions

Hey waveBoye wondering if its possible to use file system based local databases for Nextjs functions. Even just using node fs, or something like https://github.com/typicode/lowdb...

Recommendation for Tiny CSS Library

Can someone recommended a tiny CSS library to add simple styling to a demo app? Something along the lines of https://picocss.com/...

React Query: useQuery

So I am trying to implement pagination with React Query. Been reading a lot of docs and examples. In many examples, the useQuery data has a "hasMore" property. I don't have this..? When I log data, it's not there. So is there any way for me to know that the next page is the last page..?

Managing data fetching in Astro

How do you guys manage data fetching in an astro SSG website. I have some pages which will reuse content (currently fetched from a CMS API). Should i add a fetch statement at the top of each component or breakup the data into another folder and import it from there while creating some utility script to refetch new data? Any good pointers on how i should approach this problem?...

Modifying Next Auth in T3 App

I've recently launched a T3 app and some users are having trouble authenticating through the Email provider/Magic Link when using a corporate email address and Microsoft Outlook. I've searched online and the docs and come across this fix: https://authjs.dev/guides/corporate-proxies/avoid-corporate-link-checking-email-provider...

Prisma + Planetscale TLS/SLL error

I don't really know what is going on. I can do
npx prisma db push
npx prisma db push
...

Prisma `clientExtensions` Preview Feature Breaks Types

Enabling the clientExtensions preview feature in prisma.schema causes trpc routers to break all typesatefy. Anyone mess with this yet?...

Role based Authentication Question

I was looking to have an isAdmin middleware like option 2 here: https://trpc.io/docs/authorization However, my "role" field that isn't available in my context. How do I add it to my context? Sorry if thats a dumb q im new lol...

How to manage cookie preferences with Nextjs SSG?

I am trying to setup a compliance banner and preferences menu for GDPR. Haven't been able to find a proper good example... seems like there could be more moving parts than just "store a cookie" Any help is appreciated. ps. It should only show when a user connects from the EU / GDPR enforced countries...

How to create TikTok Style App with WebApp?

Hello, I'm looking to create a tiktok style app, meaning users can access videos on the web-app, but also download the app to access them there (keyword: deep-linking). The experience in the web-app is somewhat different (as you can see on the normal tiktok page, it wouldn't be fullscreen and there would be creator recommendations on the sides). With these considerations in mind, here are my thoughts: - Use create-t3-turbo to create a next + react native app...

canvas.node

Being on this canvas.node errors for some hours and i have tried so many solutions but yet, nothing is working. `node:internal/modules/cjs/loader:1203 return process.dlopen(module, path.toNamespacedPath(filename)); ^...