Skip to content

Potential infinite type recursion #3

@simonrey1

Description

@simonrey1

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions