`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.
It does call the backend but the type checking isn't working.
Solution:Jump to solution
I was reexporting my type signatures in a barrel file. Importing directly fixed the issue.
8 Replies
Also, my google-fu is failing me for this type error. Github repo doesn't seem to contain the source either.
What does your router look like?
index.ts on the left and trpc.ts on the right
Solution
I was reexporting my type signatures in a barrel file. Importing directly fixed the issue.
Hm that’s interesting, maybe a tsconfig related thing?
Yeah probably. I’m integrating trpc into an existing monorepo so have all kinds of mess going on with the paths
To clarify this if anyone is looking in the future, I have the following
server/src/utils/trpc.ts
:
And in server/src/app.ts
...
My tsconfig looks like this:
Does seem to be tsconfig themed for sure. I have a pretty basic set up, no craziness happening with paths besides what I sent above.