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

Deployment to Vercel fails

Hey all i am going through this video: https://www.youtube.com/watch?v=YkOSUVzOAA4 I am failing right in the beginning. I have made the changes to the schema.prisma. Also i have added the environment variable to the Vercel project settings. If i execute "npm run dev" everything works fine locally. Also "npx prisma db push" and "npx prisma studio". But when i deploy to Vercel i run into this error. Anyone has in idea what i am doing wrong?...

trpc alternatives like zodios, ts-rest

I am using TRPC and really liking the developer experience. I recently got to know about zodios, ts-rest etc. I believe they provide a similar experience but play along more nicely with normal REST api conventions. To use TRPC endpoints from non-typescript backends, we would need to use something like OpenApi adapters. I don't know if the adapters are stable. What are your thoughts on this ? The feeling that i get about these new alternatives is along the lines of, anything that uses a lot of typescript inference will eventually run into scale problems. (slow inference, needing to restart typescript). I even saw some github issues mentioning the typescript inference limit was reached or something....

Use function as a parameter and preserve types

Hey guys, i'm trying to figure out a way to do the following I have and interface with some functions/promises ```ts...

React-Transition-Group

Hi! I've been struggling a lot with react-transition-group and I'm wondering if there's anything obvious I'm missing. I've been following the examples presented here https://reactcommunity.org/react-transition-group/transition-group My page has a 3-tab layout which is switched using the icons at the top of the page. I then use a state enum activeView to switch between the views using the following code: ```Typescript <div className="flex grow flex-col items-center">...

Environment Variable that is a JSON object

Hi I have been trying to load a environment variable that is a JSON object (ie to load Google Cloud Service Account). In my env.mjs I added the following...

T3 app takes up too much RAM

when I start my app with npm run dev acces the nextjs app via localhost, and check the task manager, the windows powershell already takes up 300MB of RAM. I sign in using Discord provider, It takes up More! After that the just becomes unresponsive. And the terminal just goes crazyy. I could hop on a call and share my screen to show what I mean.

Not getting useInfiniteQuery as an fetching option.

I am making an infinite scroll type api but when trying to call it on frontend I am not getting useInfiniteQuery as an option. what could be the reason?
Solution:
I am making an infinite scroll type api but when trying to call it on frontend I am not getting useInfiniteQuery as an option. what could be the reason?

Figma Icons to React Components

Does anyone have a 'goto' package or plugin to handle the integration of svg (icons) created in figma to a set of react components... I really dont want to manually export and refactor all the svg -> jsx valid syntax etc everytime I want to update the figma stuff....

Webstorm vs VS code issues

Getting an error in Webstorm that does not appear in VS code. It's a brand newly scaffolded proj, has anyone come accross this before? Argument type {getAll: BuildProcedure<"query", ProcedureParams, unknown>, hello: BuildProcedure<"query", {_config: ProcedureParams["_config"], _meta: ProcedureParams["_meta"], _ctx_out: ProcedureParams["_ctx_out"], _input_in: OverwriteIfDefined<ProcedureParams["_input_in"], inferParser<ZodObject<{text: ZodString}, "strip", ZodTypeAny, {[k_1 in keyof ...<..., ...>]: ...<..., ...>[k_1]}, {[k_2 in keyof ...<...>]: ...<...>[k_2]}>>["in"]>, _input_out: OverwriteIfDefined<ProcedureParams["_input_out"], inferParser<ZodObject<{text: ZodString}, "strip", ZodTypeAny, {[k_1 in keyof ...<..., ...>]: ...<..., ...>[k_1]}, {[k_2 in keyof ...<...>]: ...<...>[k_2]}>>["out"]>, _output_in: ProcedureParams["_output_in"], _output_out: ProcedureParams["_output_out"]}, {greeting: string}>} is not assignable to parameter type Router<RouterDef<RootConfig<{ctx: FlatOverwrite<object, {ctx: Unwrap<typeof createTRPCContext>}>["ctx"] extends object ? FlatOverwrite<object, {ctx: Unwrap<typeof createTRPCContext>}>["ctx"] : object, meta: FlatOverwrite<object, {ctx: Unwrap<typeof createTRPCContext>}>["meta"] extends object ? FlatOverwrite<object,...

nextjs e-commerce template

Hi guys I'm looking for a nextJs template to setup an e-commerce website but I'm not sure what to use, just a fast one. so I came to hear your opinion about setting up an e-commerce website

Which icon set would you recommend?

If you have a different icon set that you like, I will add it to the list. 🇦 - Heroicons 2 https://github.com/tailwindlabs/heroicons 🇧 - Material Design icons http://google.github.io/material-design-icons 🇨 - Ant Design Icons https://github.com/ant-design/ant-design-icons...

Best practices in auth

Wanted to know what most of you are using as best practices in auth As I have nearly no experience with auth, and not sure where to start Like to use auth0, authjs and today I saw lucia-auth which looked like an easy start, even though it sounds bad to store sessions in db Or just straight go to supabase auth as im using it as storage and postgress host...

Can't import defaultTheme from tailwind.

I wanna refacor my entire app from daisyUI to shadcn UI but I can't really change anything in tailwind config config: ``` const { fontFamily } = require("tailwindcss/defaultTheme");...

Prettier issue with multiline code blocks

Hey! I'm trying to use Nextra and prettier in VS Ccde. However, I cannot create code blocks. The issue is, whenever I create one, prettier automatically puts everything in one line making the code block broken (see in the video). Am I missing something in my config file? I have it set to default for now. Thanks 🙂...

Vim "virtual text?!?" fix

The issue is that when there's an error in nvim, the error message is going through the screen and its imposible to read it
Solution:
I don't know if you can reflow the error text to line wrap or something like that. But you can bind a key to vim.diagnostic.open_float() to get a popup similar to vim.lsp.buf.hover() which shows you the error in it's entirety

infinite scrolling is not working working properly in throttling

when network connection are strong my reverse infinite scrolling is working fine but when I am using throttling it start pushing it to top without user interaction can anyone tell me why it happening and how can I solve this problem With Throttling video :- reality.mp4 Without Throttling video :- expectation.mp4 code:- https://github.com/pradeep800/chat-bot/blob/main/src/pages/%5Broomid%5D/index.tsx...

Add reusable custom logic in procedure

How can I access projectId in my procedure? Currently I have to rewrite that piece of logic everywhere. I would like to write it once in a procedure.

framework suggestions to build a blog

So i am trying to build my personal blog. i would have gladly used T3 stack, but i have heard enough bad things in regards to SEO with next js So i need suggestions on what stack or framework that will best suit my needs with very good SEO...

Error spammed on my console

hello, i am using t3 stack with clerk and am getting this error: ```event - compiled client and server successfully in 435 ms (380 modules) wait - compiling /api/trpc/[trpc] (client and server)... error - unhandledRejection: TypeError: Cannot read property 'timeoutType' of undefined at _resume (evalmachine.<anonymous>:11000:33)...

Trying to implement infinite scroll with infinite query

So i was looking at this video to see how this guy implememented infintie scroll: https://www.youtube.com/watch?v=nzJsYJPCc80&t=3592s (his github repo in description, and the part of the video is labeled), and the way he made it is kind of glitchy, when I scroll down, it just fetches the same data over and over which happens in his video as well, and when I print the nextcursor, which is the id of the next record, its always the same for some reason. I pretty much have the same code as him except I just have my own schema that i use instead of tweet, which shouldn't make a difference at all....