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

Theo's browser

Hi, I saw in one of Theo videos that he have option in browser that allow him to have 2 tabs opened at once in one window, how I can do similar thing in firefox? (sorry if that's stupid question)

Trouble Setting Up Environment From Scratch

Hey everyone, Im new to T3 stack and wondering what I may be missing to have everything setup on my end correctly. When I run through creating a new T3 app from scratch, Im running into some errors that makes it seem there are some pieces that arent connected properly. For more context, heres a loom video that shows what Im running into:...

SVG brand logo website

Hey does anyone know the website that theo uses to get all brand logo svgs? Thanks

anyone running into failed to connect to daemon? i cant run pnpm dev

```21/07/24 10:57:18] ➜ sol-eats git:(main) ✗ pnpm dev
create-t3-turbo@ dev /Users/daniel/Documents/Repos/sol-eats turbo watch dev
...

Help with multiple prisma clients in a turbo monorepo

With the original Prisma setup in my production turborepo with 2 nextjs projects I, ran into an issue where after postinstall prisma generate overwrote each other iniside the node_modules . Therefore I found my exact issue here https://github.com/vercel/turbo/discussions/3493. and applied the fix that was mentioned here https://github.com/vercel/turbo/discussions/3493#discussioncomment-7090955. Now my project seems to build fine locally and it also build fine successfully on vercel. But when i to a page that has a db fetch it fails with th e following error.
Unhandled Rejection: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs. This is likely caused by a bundler that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" next to the resulting bundle. Ensure that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied next to the bundle or in "node_modules/.prisma/client". We would appreciate if you could take the time to share some information with us. Please help us by answering a few questions: https://pris.ly/engine-not-found-bundler-investigation The following locations have been searched: /var/task/apps/web/node_modules/.prisma/client /var/task/apps/web/.next/server /vercel/path0/apps/web/node_modules/.prisma/client /var/task/apps/web/.prisma/client /tmp/prisma-engines at wa (/var/task/apps/web/.next/server/chunks/5042.js:64:756) at async Object.loadLibrary (/var/task/apps/web/.next/server/chunks/5042.js:111:10016) at async wt.loadEngine (/var/task/apps/web/.next/server/chunks/5042.js:112:448) at async wt.instantiateLibrary (/var/task/apps/web/.next/server/chunks/5042.js:111:12736) { clientVersion: '5.15.1', errorCode: undefined } Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
Unhandled Rejection: PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs. This is likely caused by a bundler that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" next to the resulting bundle. Ensure that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied next to the bundle or in "node_modules/.prisma/client". We would appreciate if you could take the time to share some information with us. Please help us by answering a few questions: https://pris.ly/engine-not-found-bundler-investigation The following locations have been searched: /var/task/apps/web/node_modules/.prisma/client /var/task/apps/web/.next/server /vercel/path0/apps/web/node_modules/.prisma/client /var/task/apps/web/.prisma/client /tmp/prisma-engines at wa (/var/task/apps/web/.next/server/chunks/5042.js:64:756) at async Object.loadLibrary (/var/task/apps/web/.next/server/chunks/5042.js:111:10016) at async wt.loadEngine (/var/task/apps/web/.next/server/chunks/5042.js:112:448) at async wt.instantiateLibrary (/var/task/apps/web/.next/server/chunks/5042.js:111:12736) { clientVersion: '5.15.1', errorCode: undefined } Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
...

What's a good way to persist a single query for React Query

React query provides a persisted query client for persisting query results, but it seems to be for the whole app. What's a good way to persist a query result for a single query? (Using Nextjs + TRPC)

Shadcn and UploadThing component

```ts "use client"; import { UploadButton } from "@/lib/uploadthing"; import { toast } from "sonner"; ...

Cloud Image Storage

Hi, I was wondering if it is posible that when someone uploads an image it is stored in a google drive folder and in the database it keeps the url to that image?
No description

RRule datetime generation randomly wrong

I am making a project using google calendar. I am using the rrule library to generate dates for event times. ```ts import { z } from "zod"; import { calendar_v3, google } from "googleapis"; import { DateTime } from "luxon";...
Solution:
its dts

T3 stack having a NestJS backend already

I'm working on a side project and so far I have a react native app consuming a NestJS backend with REST API. Now I want to make the web part of it with NextJS. I saw the T3 stack and was wondering if it makes any sense to use it since I already have a REST API and T3 uses tRPC. Is it possible to work with both? Any benefit or better just go simple here...

is manually setting props of a component returned by a render prop considered bad practice?

let's say i have this component: ```tsx function Foo(props: {renderSomething: (param: any) => VNode}) { const rendered = props.renderSomething("hi theo");...
Solution:
```tsx function Foo(props: {renderSomething: (param: any) => VNode}) { const rendered = props.renderSomething("hi theo"); const derivedSomething = useMemo(() => { return {...rendered, someProp: 2}...

Calling same TRPC endpoint from multiple components

Hey! I want to call the same trpc endpoint, with a refetch interval of 5 seconds, from multiple components. How do i make it so each component doesn't send the same request? Can i make the use the same responses somehow? Thanks in advance....

How does the use client directive affect component rendering in Next.js

Does the "use client" directive in TRPCReactProvider mean that all components wrapped by TRPCReactProvider in RootLayout will be rendered on the client side?

which method is better for authentication

i am building an app using mysql , next js , nodejs-express , socket io i am currently in the phase of authentication and registering users in my database with all of their info (email,username,password etc..) the question is do i just encrypt users password in my database when they register into my App or do i use an authentication solution , the registeration data will be sent to the express server where the insertion process will take place in my database when the user sign in i am plannin...

Creating video from images

I have a lot of images in a page, and I want to allow my users to download the images as a video. It'd be great if that can be done on the client side so I don't have to think about or pay for servers. I tried @ffmpeg/ffmpeg but it gives the following error message, even when exactly following the example provided ```ts ⨯ ModuleBuildError: ./node_modules/@ffmpeg/ffmpeg/dist/esm/classes.js:104:28 Module not found...

Using fetch with typescript leads to Unsafe assignment of an `any` value.

Hi all, Is anyone able to tell me why I am receving this linting issue "Unsafe assignment of an any value." when trying to use fetch json response method? ``` export async function GetPlaylist( ctx: TRPCContext,...
No description

Anyone Seeing Static Files Fail to Generate in a Monorepo?

I have a monorepo setup, and I ran the create-t3 script to generate a new web app. Dev was working fine, but whenever I try to build I get an error creating the 500 and 404 pages. If I install dependencies "locally" within the app's directory instead of at the monorepo's project root the build runs successfully. Has anyone else run into this?...

Next.js caching

Hey guys, I'm having a hard time understading what is wrong here. I made a simple repo: https://github.com/HellYeahOmg/revalidate-test Main page has a get request for some items, the second page has a form to add items. After submitting the form i expect to see the updated result on the main page. I added every disabling cache option i could, but it still doesnt work unless i hit router.request() or revalidatePath(). Why so?...

Zed for Windows Custom LSPs (WSL)

Got Zed running on Windows, does anyone know how to tell Zed to look for LSPs in WSL, or to specify custom commands for LSPs?