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

drizzle

Just a heads up, if you are having issues using, run db:push and get these error messages, please try connecting to another network and do the push again, your provided ip might be blacklisted, or your isp might have them blacklisted:thinkies: , after connecting to my hotspot i was able to do the push and connect to drizzle studio without issues
Solution:
Just a heads up, if you are having issues using, run db:push and get these error messages, please try connecting to another network and do the push again, your provided ip might be blacklisted, or your isp might have them blacklisted:thinkies: , after connecting to my hotspot i was able to do the push and connect to drizzle studio without issues
No description

applying migrations...Error: getaddrinfo ENOTFOUND postgres

Hi Guys , I am using nextjs app router with drizzle with postgres and its working fine in development mode but when i am running it with docker compose up --build its giving me this error ``` [⣷] applying migrations...Error: getaddrinfo ENOTFOUND postgres 1.013 at /app/node_modules/pg-pool/index.js:45:11...

What's the best logging service for nextjs?

I am currently looking for a good logging service for my nextjs application, i have gone and tried axiom which i liked however reading through things seemed to run pretty slow in server function with having to clean up afterwards (flushing). I am currently using posthog for my analytics which i really love. ...

t3 tRPC - CTX is undefined

Hey all. Finally checking t3 for the first time. Question. I was trying to add to the latest post query so that the latest post will be from the current user not all users....
No description

trpc prefetch fails when building app

tRPC fails to get the data when it is build the application as the tRPC server cannot run when building. Any thoughts on how to fix this issue? ```tsx...
Solution:
export const dynamic = "force-dynamic";
export const dynamic = "force-dynamic";
...

Server actions in server components

I have been under the assumption that calling a function marked with use server on the server is just treated as a regular server function. But I then stumbled upon a random vid where the guy mentions that calling a server action from the server means the server will be fetching from what's effectively an API route the same way client components do. Couldn't find explicit evidence for this claim though. ...

does the interviewer (technical interviewer) or dev responsible for hiring review your projects code

I am refactoring an old project it's an ecommerce project i didn't have the option to view the product in a seprate page so i wanted to add that option , I have my products stored in an Array in firebase now that i understand firebase more i learned that i can't use it's querying capabilities to filter my results instead of having to loop over the whole Array to get the item i want it's a total of 226 items i know that if i add more products it will effect performance later there is two cho...

Server side data fetching based on input from a client

So, I want to fetch data on the server with server components based on the input from the client component in this case workspaceSlug. What is the best approach to go around this? I tried the pattern in this picture i havent got it to work
No description

trpc useQuery/useMutation not inferring return type of prisma query

Env: Node18 , npm i'm using turborepo with the server as Honojs + hono-trpc adapter and the client as react vite So i've already did the setup as said in the docs and everything is working perfectly everything returned from the trpc procedures is inferred except when i return a prisma query then the inferred type is "any" ?? ...
Solution:
i solved it so it was an error with the context which contains (prisma and telegram bot) not being inferred from the client so i had to type it manually now all returned prisma queries works as expected...
No description

AWS Amplify & T3 stack env var issue

I’m small app with for now only auth and is not detecting env vars on amplify I created with next auth, tailwind and nothing else. On the logs I only see that the next auth and provider env vars are not detected with the message that they are required...

Does uploadthing have an automatic delete feature?

I wanted to know whether or not uploadthing can check how old the files are and delete it if its older than a certain period of time.

NextJS prefetch bad for bandwidth?

From what I understand nextjs links prefetch pages as soon as the link is visible on the viewport. Isn't this terrible for large apps, for example my job is building headless ecommerce sites and the products page could have almost a hundred links if you include the navigation bar, footer & products. Wouldn't this be prefetching a hundred pages & very bad for bandwidth? In ecommerce the majority of consumers are mobile visitors which means they could be on limited mobile data. I've tried to search for anything on bandwidth + prefetching on the docs but couldn't find anything. I've found some articles on how NextJS supposedly accounts for low bandwidth users but got no deeper detail how or when it does this....

UploadThingError at INTERNAL_DO_NOT_USE__fatalClientError

I get this errors on uplaoding - GET https://api.uploadthing.com/v6/serverCallback net::ERR_BLOCKED_BY_CLIENT - Something went wrong. Please contact UploadThing and provide the following cause: FetchError...

Uploading a File Via POST

I understand that most people use the client React components, but I am trying to upload a file on the server side by making a POST request to the main route, however, I noticed that it only accepts JSON and I was wondering if you were able to use form-data? I am testing this in Postman, but it doesn't seem to work.
No description

Code ownership

Does a company own my code if I they didn't hire me for programming, but I wrote some to simplify certain tasks? Just asking out of curiosity. I am not planning to publish/do anything with it....

Delete file using supabase

I would like to use supabase edge function to delete a file when a delete event happen, is there a documentation on how to set up connection to uplaodthings from this environment?

tRPC fetch breaking when building Next project

I'm testing out tRPC, and I've tried fetching some asynchronous data. This only happens during pnpm build, dev mode works completely fine. The fetch is prefetched in the page, and then actually fetched within the component. It always errors in this way when it gets to the static page generation step....
No description

Extending React Markdown with any component

Hi, I'm trying to implement charts into the markdown langauge. Currently, I'm using Mermaid for some basic charts but I want to implement my own. For example: ```markdown pie title Pets adopted by volunteers...

Building an npm package that has server actions

Hi i am building a small npm package and i want it to use server-actions a bit stuck for a couple of days and i just can't seem to find good examples, runing into tbh propper skill issues when it comes to building standalone packages. Would really apreciate help.