Chuuy
Chuuy
TTCTheo's Typesafe Cult
Created by Chuuy on 4/14/2024 in #questions
T3 Stack: tRPC not extending type definitions to client
Thank you for all the help and I'll update this thread if I end up resolving the issue one way or another so that if someone else runs into the same issue they can stumble across this!
14 replies
TTCTheo's Typesafe Cult
Created by Chuuy on 4/14/2024 in #questions
T3 Stack: tRPC not extending type definitions to client
I tried to do some more digging to see if anyone else was having issues with this error and found a couple pages and came across this page (https://github.com/trpc/trpc/issues/5614) which seems to include all of the reproductions similar to what I was experiencing except within a monorepo with a shared tRPC package instead of my create-t3-app. He mentions a bit about how there were problems probably caused by the fact he used commonjs in his server but I'm using esnext which is the suggested compiler option and still getting these issues. So I dug deeper into the linked issues (https://github.com/trpc/trpc/issues/3496). It seems he explicitly re-exported these types from the "trpc's unstable-core-do-not-import" package in his index.ts (https://github.com/akashdevcc/zero-stack/blob/main/packages/trpc/src/index.ts, lines 24-32) file which resolved those issues for him and caused the type inference issues to go away. I'm going to try the same thing and see if it resolves my problems as well and will report back because I've been pretty heads down on this just trying to get some kind of different error I can work off of. If that doesn't work then I'm going to create a new t3-turbo app and incrementally migrate all of my current project into the new one and hopefully through that I'll see where the problem may have been or maybe it will get resolved in a different project with updated dependencies.
14 replies
TTCTheo's Typesafe Cult
Created by Chuuy on 4/14/2024 in #questions
T3 Stack: tRPC not extending type definitions to client
Hey, I appreciate all of your help but I don't think I'm getting anywhere with the issue after messing around with things for a couple days. I followed your suggestions and created a new t3-app@latest and then deprecated the versions to try and recreate the situation that I'm currently in and only found that a bunch of errors come from what I assume to be methods that exist in the v11 of tRPC and not in v10 which I'm currently on. Tried cleaning that up but ended up with the same error which I cannot pinpoint exactly where it comes from. From what I assume it has something to do with my _app.ts folder in my trpc server folder has an 'any' definition for the appRouter that we create and export to create the tRPCNextClient which will be consumed by the client side of my application. The router (from trpc.ts in trpc server directory) that I import in the _app.ts file is properly typed when I hover over with the BuiltRouter<etc...> but variable I am saving this router to, appRouter, has implicity a type of 'any'. This is where I believe the error to be occurring. I don't exactly know what I did to cause this but as a result I have tried doing patch, minor and major upgrades of tRPC using the "npx ncu" command and despite it being on an updated version of the library I am still getting these type errors where the appRouter is coming back as 'any' type.
14 replies
TTCTheo's Typesafe Cult
Created by Chuuy on 4/14/2024 in #questions
T3 Stack: tRPC not extending type definitions to client
Hey, I created the minimal reproduction in codesandbox. It seems to be having some issues with the "@types/react" where the AppProps don't seem to be working but that is not an issue that I have in my repo. I think the important piece is that it is showing all of the errors that I'm experiencing with trpc in the virtual editor environment
14 replies
TTCTheo's Typesafe Cult
Created by Chuuy on 4/14/2024 in #questions
T3 Stack: tRPC not extending type definitions to client
Sorry, I did not mean to offend or be inconsiderate in any way. This is my first time reaching out for help outside of work and first experience with any form of open source communication. I appreciate the explanation and your time to get this resource to me. I will get to work on trying to create a codesandbox or small example repo like detailed in the video after I finish work today. I appreciate the help and again I apologize if this came off the way described in the video
14 replies
TTCTheo's Typesafe Cult
Created by Chuuy on 4/14/2024 in #questions
T3 Stack: tRPC not extending type definitions to client
Almost all of my components in the components directory under src have some kind of tRPC call and I did my type inference exporting under server/trpc/exportedTypes.ts. Let me know if there is any other information that I can give to help for context
14 replies
TTCTheo's Typesafe Cult
Created by Chuuy on 4/14/2024 in #questions
T3 Stack: tRPC not extending type definitions to client
I'm currently working off of this branch: https://github.com/gsayre/tournamate/tree/feature/tou-48. Sorry I don't know how to create a minimal reproduction as I don't fully understand what is happening here 😔
14 replies