Typedef
Typedef2y ago

[Help] Turbo shared types

I have a turborepo with two apps (web and embed). web is a t3 stack and embed is a create-react-app. I am trying to use the trpc endpoint from web to embed. I managed to make it work by configuring web's cors. However, I am getting type issues when importing AppRouter in the embed app. I don't think you can just import AppRouter from web like import type { AppRouter } from "../../../web/src/server/routers/_app"; which is currently what I am doing. So my question is how would I go about this? do I need to somehow share the types between the two? if so how would I do it?. Should I just seperate trpc as an internal package?
2 Replies
sachin
sachin2y ago
check out https://github.com/t3-oss/create-t3-turbo uses React Native but the idea of sharing types is the same
GitHub
GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo usin...
Clean and simple starter repo using the T3 Stack along with Expo React Native - GitHub - t3-oss/create-t3-turbo: Clean and simple starter repo using the T3 Stack along with Expo React Native
Typedef
TypedefOP2y ago
Thanks, ill check it out