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

Property 'useMutation' does not exist

Hello, I'm very new to T3 and pretty new to coding in general. Going through my first tutorial on youtube to build a simple application and it seems like there has been some small changes made recently in how you set up simple CRUD and I can't seem to figure it . Problem is simply that whenever I try to use tRPC's useMutation method here, it simply gives me an error saying that it "does not exist on type '{ useContext():..." despite following the tutorial. ``` const Home: NextPage = () => { const [snippetText, setSnippetText] = useState("");...

How to check if all the data from multiple components is loaded

If my page consists of multiple components that each use trpc.useQuery inside them, how should I check if all the data from them is ready to go? For example trying to do the loading screen if all the data is not ready inside my index page. To be more clear I have lets say Table and Navbar component and want to load the index page where the nav and table are if all data from them is loaded....

Is there a simple way of doing the the Blur Effect with Next-Image in MDX?

I just looked into this and it seems like such a pain to accomplish, esp. with Images in MDX? (e.g. : https://nikolovlazar.com/blog/generating-blur-for-dynamic-images-nextjs) Base64 also seems not the most beautiful of blurs and the plaiceholder docs really don't say anything about the options and what values they take. What do would you recommend?...

tRPC basics - returning an array

I suspect this is my ignorance of typescript. I am just not getting anywhere with this tRPC set up. I just want to return an array, but my query result is empty. Router `const partyList = [ { firstName: 'joe',...

am I self taught ?

Can someone who studied at a university be considered self taught ? In my situation I’d say 80% of what I know is because I took the initiative and spend time to learn new skills by myself. While I was doing that of course, I was also pursuing a Computer science degree. But after graduating I cannot say that the degree “boosted” me or it helped me or that it opened doors for me. But for most people that don’t follow an academic career, I believe it’s a similar situation for them....

database write on button click

How do I do it? I can't use trpc(can only make calls at top level), I could make an api endpoint, I tried, it's kind of awkward and looks like this: `` const callAPI = async () => { try { const res = await fetch(http://localhost:3000/api/cookbook/create`, {...

Mac Cleaner

Does anyone have some experience with mac cleaner apps?

how to fix OAuthAccountNotLinked in NextAuth (pretty way?)

AFAIK this is happening because I'm signing in using same email but different auth provider (Google, Discord, Github), is there any way to not get a error screen??

TW-Elements

Hello! I'm trying to add tw-elements to the project and I get this error:
Could not find a declaration file for module 'tw-elements'. 'c:/Users/Adek/Documents/nextjs/my-t3-app/node_modules/tw-elements/dist/js/index.min.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/tw-elements` if it exists or add a new declaration (.d.ts) file containing `declare module 'tw-elements';`
Could not find a declaration file for module 'tw-elements'. 'c:/Users/Adek/Documents/nextjs/my-t3-app/node_modules/tw-elements/dist/js/index.min.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/tw-elements` if it exists or add a new declaration (.d.ts) file containing `declare module 'tw-elements';`
...

Load Testing APIs, trying to simulate behavior of users who is hitting same API to progress.

Anyone have any Idea on how you can loadtest backend nodejs API, trying to simulate a one after another request by the same user and multiple of them. Is this enough what other scenarios I should think of or is there anything else am I missing? I'm using jmeter for now, But I'm open to anything else

Eslint Setup?

I added a eslint config file which looks like this to my t3 project: ```ts { "env": { "browser": true,...

Tiptap vs. Lexical

Need a WYSIWYG editor, but never used one outside of Quill.js which was pretty shit. Seen Tiptap and Lexicall reccommended. Also using react-hook-form. Any other recommendations? Experience using them with RHF?

Reduce problem

Someone that has a clean solution for this? I have this data structure: ```ts posts: Post[]...

integration

Super don't know where / how to ask this but any of the Sr's here ever had to do any Google/Microsoft API integrations? We've got a multi-tenant platform we're trying to leverage Microsofts Graph API to sync calendar events of users with our DB (for a calendar events page we'll build out)... I've built Google Contacts integration and a co-worker did our MSTeams Bot but in both cases we've had to leverage a per user OAuth flow which means double login's for our users......

CSS EFFECT

Hi, I am building a website inspired in Cyberpunk 2077. I am using some things from their site as a reference, and they have a pretty cool effect on hover that seems like a cyber thing that I would like to implement on my site, but I have no idea how to build this. If someone could help me with it would be awesome.

TRPC mutation example with relationships

Hey, I'm building an e-commerce site as a side project but I'm not sure how to make use of the mutation method with relationships. Have anyone seen an example that handles these cases? This would be step where the user has entered his details in a form and I already have the Product(s) in the cart global state. My prisma schema is something like this:...

TypeScript adoption at work

I'm a more junior developer with just about three years of experience. Recently, we were given the go-ahead to start using TypeScript for a newer more green field project to test the waters. I think it's been a great experience, and has given me more confidence in the robustness of my code, and in the safety of my refactoring. Currently, something of a round table is happening where devs from various teams are being asked about whether we should use TS for a shared component library that is being started. There's some pushback from some of the more senior developers, in particular one who stated "The kinds of errors that type safety is intended to assist in the prevention of are generally avoidable with good coding practices.". Obviously I'm not going to die on this hill. I'm perfectly fine with the conclusion that different teams can make the decision for themselves, and that it should not be enforced necessarily. However, being a bit newer, I want to make sure I'm accurately presenting the biggest advantages. Does anyone have any advice on how to respond to that sentiment, or the sorts of things I can bring up in support? Thanks, have a great day!...

Is there something like create-t3-app for electronJS?

So I guess ts, trpc, tailwind, react, prisma, webpack(?)

Filtering in React-Query & Trpc?

Say I have a filter on my frontend. I have an option to get all the users who are blue or all the users who are red. In the front-end, I pass that filter value into react-query and in the backend I use that passed-down filter value in my prisma call to my database. In trpc/react-query I do: ```javascript...

JS library for visualizing & interacting with graph db

Does anyone know if there is a good npm package or some other good off the shelf solution for visualizing and interacting with relations in a graph database? For example with a role based access system, figuring out through which edges someone has access to a role, and changing this. We're using Memgraph, which uses the same Cypher query language as Neo4j.