tRPC query has any type

I'm using turbo repo for trpc (with express) and react-native, I made mutation query, but in client side when I try to use trpc it has any type on queries @/api/auth
export const auth = publicProcedure
.input(
z.object({
token: z.string(),
provider: z.enum(["google", "apple", "spotify"]),
})
)
// ...
export const auth = publicProcedure
.input(
z.object({
token: z.string(),
provider: z.enum(["google", "apple", "spotify"]),
})
)
// ...
server.ts
import { createTRPCRouter } from ".";
import { auth } from "@/api/auth";

export const appRouter = createTRPCRouter({ auth });

export type AppRouter = typeof appRouter;
import { createTRPCRouter } from ".";
import { auth } from "@/api/auth";

export const appRouter = createTRPCRouter({ auth });

export type AppRouter = typeof appRouter;
and from index.ts I export AppRouter type client.ts
import { createTRPCReact } from '@trpc/react-query'
import type { AppRouter } from 'backend'

export const api = createTRPCReact<AppRouter>()
import { createTRPCReact } from '@trpc/react-query'
import type { AppRouter } from 'backend'

export const api = createTRPCReact<AppRouter>()
so whenever I use api.auth auth type is any but why?? I don't get it I actually followed t3-app configuration of nextjs
5 Replies
yaviscoke
yaviscoke7mo ago
No description
yaviscoke
yaviscoke7mo ago
also this is my packages/backend package.json that I export types from index.ts
No description
yaviscoke
yaviscoke6mo ago
Sad found issue but idk how to fix it
yaviscoke
yaviscoke6mo ago
if I imort publicProcedure like that ../../
No description
yaviscoke
yaviscoke6mo ago
type checking works but if I do @/trpc it no longer works issue comes from tsconfig
Want results from more Discord servers?
Add your server
More Posts
I MUST BE DOING SOMETHING WRONG Prismadb + TypescriptI MUST BE DOING SOMETHING WRONG Prismadb + Typescript I have been "playing" with typescript this weCaching Images Next.jsSomeone that has any good ideas / thoughts on how to use caching of images well in Next.js? Should aDoes anyone know how to speed up presigning S3 URLs?I'm working on a toy project where users upload content, and I noticed that it takes forever to loadHow to perform 2 trpc queries, when I need the second query to rely on data from the first?Sorry for making the title so complex What I need is simple. I need to make 2 requests but get some Inferred Type Parameter from a Fixed Union is Different from a Parameter that is a Fixed UnionSo this took me embarrassingly long to figure out how to articulate, hoping it saves someone a lot oHow to dynamically display iconsSo in my app i want to dynamically display icons from a `string[]` but it doesn't seem to want to woPrisma Two of the same model inside of a model```prisma // This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/Is it possible to pass access tokens to react server components?I have an access token that's stored in local storage. Using the access token in client components iNextJs webhook revalidationI’m stumped trying to get my head around how this workflow should work and get a simple example workShadcn DropdownMenu - Property 'className' does not exist on type 'Omit<DropdownMenuSubTriggerPropsLocal is building and starting without any issues. This only happens on Vercel's deployment `Proper