mh15M
tRPCβ€’3y agoβ€’
18 replies
mh15

`The property 'query' in your router collides with a built-in method`

I'm seeing an error (attached) where I can get autocompletes on TRPC in the file where the client is defined, but not anywhere I import it in.

// client.ts
import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";

import type { AppRouter } from "wherever";

export const trpcClient = createTRPCProxyClient<AppRouter>({
  links: [
    httpBatchLink({
      url: `whatever`,
      // You can pass any HTTP headers you wish here
      async headers() {
        return {
          authorization: "whatever",
        };
      },
    }),
  ],
});

It does call the backend but the type checking isn't working.
image.png
Solution
I was reexporting my type signatures in a barrel file. Importing directly fixed the issue.
Was this page helpful?