Hussam
Hussam
TtRPC
Created by ygor perez on 5/13/2023 in #❓-help
How do I prefetch the nextPage of an infiniteQuery?
then keep calling fetchNextPage on the onSuccess handler until there are no results
7 replies
TtRPC
Created by ygor perez on 5/13/2023 in #❓-help
How do I prefetch the nextPage of an infiniteQuery?
why don't you call query.fetchNextPage based on the scrollbar position, if you want to prefetch it, make it in such a way that next page is fetched well before the user reaches the bottom of the page. you have to figure out when you want to prefetch, I don't think you would want to call it repeatedly until there are no results left.
7 replies
TtRPC
Created by Hussam on 3/7/2023 in #❓-help
How to infer types of a query
Ended up using QueryObserverResult import { QueryObserverResult } from '@tanstack/react-query';
6 replies
TtRPC
Created by Hussam on 3/30/2023 in #❓-help
The inferred type of this node exceeds the maximum length the compiler will serialize.
I moved everything into router({ }) , and the type error is gone. Just a head ups @Nick Lucas, it's fixed for me now. I hadn't created a github issue, as I couldn't reproduce the issue easily. thanks a lot all of you.
19 replies
TtRPC
Created by Hussam on 3/30/2023 in #❓-help
The inferred type of this node exceeds the maximum length the compiler will serialize.
just so that I get to question right Did you mean I could do this instead ?
export const appRouter = mergeRouters(
router12,
router1,
router2,
router3,
......
);
export const appRouter = mergeRouters(
router12,
router1,
router2,
router3,
......
);
I followed this setup, https://github.com/calcom/cal.com/blob/main/packages/trpc/server/routers/viewer.tsx#LL1281C20-L1281C20, Also, thanks you made me realize router() is Deprecated https://trpc.io/docs/typedoc/server/functions/router-1#deprecated
19 replies
TtRPC
Created by Hussam on 3/30/2023 in #❓-help
The inferred type of this node exceeds the maximum length the compiler will serialize.
sure, thanks.
19 replies
TtRPC
Created by Hussam on 3/30/2023 in #❓-help
The inferred type of this node exceeds the maximum length the compiler will serialize.
yup, it's set to true
19 replies
TtRPC
Created by Hussam on 3/30/2023 in #❓-help
The inferred type of this node exceeds the maximum length the compiler will serialize.
Oh and I forgot to mention, it works when I set declaration: false in tsconfig.json. I dont know, if that's okay or will have cons for it
19 replies
TtRPC
Created by Hussam on 3/30/2023 in #❓-help
The inferred type of this node exceeds the maximum length the compiler will serialize.
export const appRouter = mergeRouters(
router12,
router({
router1,
router2,
router3,
router4,
router5,
router6,
router7,
router8,
router9
router10,
router11,
// router13,
// router14,
// router15,
}),
);
export const appRouter = mergeRouters(
router12,
router({
router1,
router2,
router3,
router4,
router5,
router6,
router7,
router8,
router9
router10,
router11,
// router13,
// router14,
// router15,
}),
);
uncommenting any of the last three gives that type error on appRouter
19 replies
TtRPC
Created by Hussam on 3/30/2023 in #❓-help
The inferred type of this node exceeds the maximum length the compiler will serialize.
it's a private repo, I can share snippet if you like to. I am referring to cal.com setup, my local setup for cal.com also error out the same way. https://github.com/calcom/cal.com/blob/main/packages/trpc/server/routers/viewer.tsx#LL1281C20-L1281C20,
19 replies
TtRPC
Created by Hussam on 3/7/2023 in #❓-help
How to infer types of a query
this does not work. I am trying to look into the other option. thanks a lot Nick
6 replies
TtRPC
Created by Eternal Mori on 3/7/2023 in #❓-help
How to infer types from input?
3 replies
TtRPC
Created by Mugetsu on 12/13/2022 in #❓-help
tRPC Client webpack error
got it thanks.
55 replies
TtRPC
Created by Mugetsu on 12/13/2022 in #❓-help
tRPC Client webpack error
Hey, can you say me more about this. I am running into this problem , I'm using turborepo with next13
../../packages/trpc/utils/trpc.ts
Module parse failed: Unexpected token (3:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

> import type { AppRouter } from '../server/routers/_app';
../../packages/trpc/utils/trpc.ts
Module parse failed: Unexpected token (3:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

> import type { AppRouter } from '../server/routers/_app';
55 replies