MerlinM
tRPC2y ago
6 replies
Merlin

React type errors because of backend

Hello, I'm using tRPC in React and it's working fine generally. However, WebPack always finds something to complain about that is in my backend where I import AppRouter from and I haven't found a clean way yet to fix this.

As you see in the screenshot, it complains about some fastify types. Those errors aren't present on the backend side and I could just install the types in my react repo too, but that does feel really dirty. Is there a nice way to handle this?

Thanks in advance. And generally spoken, tRPC is the best API layer I have ever used. I come from ApolloGraphQL which is kind of nice, but also always a pain to set up.
image.png
Was this page helpful?