zenstackhq / sample-todo-trpc

A complete Todo app sample built with ZenStack, tRPC, and Next.js
https://zenstack-todo-trpc.vercel.app
23 stars 2 forks source link

Potential infinite type recursion #3

Open eqqe opened 3 months ago

eqqe commented 3 months ago

I was using this project as a starter, and I had type inferences taking a long time. I deleted the <AppRouter> type annotation (and removed the import)

export const trpc = createTRPCNext({
    config({ ctx }) {
        return {
            transformer: superjson,
            links: [
                httpBatchLink({
                    url: `${getBaseUrl()}/api/trpc`,
                }),
            ],
        };
    },
    ssr: false,
});

I deleted

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

<AppRouter>
// @ts-ignore
export default trpc.withTRPC(App);

https://github.com/eqqe/application-nextjs-tanstack/pull/39/files

Now my project is much faster in VSCode and build, and I still have all the trpc autocompletion :)