createTRPCNext returns strings, cannot use .withTRPC()
createTRPCNext returns error strings so I cannot use its withTRPC method.
⤴️ this was copied from one of the examples so should cause the error.
the type of AppRouter is definitely correct (and is correctly imported) and has no routers/procedures named as the error suggests <- this was also copied from an example
what else can cause this error?
help or any ideas would be appreciated, thanks! 🫶


9 Replies
does this happen on a stock t3 app?
not at all
i'm pretty sure it is related to how i handle type imports
@cje i'd appreciate it if you could take a look on the repo
https://github.com/SGeri/expo-next-trpc
what i can tell is that vscode doesnt give any references where i import the AppRouter type

meanwhile it does give info in the create-t3-turbo repo which should be similar (if not the same) at this point

the only difference between the importing method is that all of my dependencies are in the root package.json not split into each app/package
but as far as i know it shouldnt be a problem
it works when you just stick a createTRPCNext in the same file as where the app router is
so its something about your monorepo setup
well yes but what can i do about it? ive tried renaming the package to anything else and even importing it directly from the next's package.json but that way
npm i
didnt even run

but @packages/api is definitely valid, it is defined in the package's package.json
