t
tRPC
t
tRPC
Type error when using createTRPCReact<AppRouter>()
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
B
backbone
•
3/4/23, 1:35 AM
Do you fix this question
N
Nick
•
3/4/23, 8:19 AM
Could you share your setup files for the backend and frontend
?
N
Nick
•
3/4/23, 10:00 AM
I think the problem may be importing from a different package using a relative import but not having done any other setup around it
N
Nick
•
3/4/23, 10:01 AM
In the web project tsconfig
,
“include
” that relative file to tell typescript to check it
N
Nick
•
3/4/23, 10:01 AM
That
’s likely the simplest thing and I think should work
N
Nick
•
3/4/23, 10:05 AM
The more complete way might be to leverage workspaces fully and add the api as a dependency of the web project
, then import the type by the package name
. There would be more to do though in terms of exposing the types from the api package
N
Nick
•
3/4/23, 10:06 AM
tsconfig include has worked for me with Nx and is simpler