Monorepo import issues
We're currently creating a POC migrating a feature from Next.js to tanstack start.
We're encountering issues with paths, e.g:
Cannot resolve
@repo/database
. The TS compiler does not complain, since it's in package.json
and installed, however, the app seems to fail.
Also, it raises issues from within packages like @repo/ui
which holds all the ui components.
As an example, in button.tsx
which is in @repo/ui
we have an import to import { X } from '@repo/ui/x
which is resolved just fine in Next.js, since it has the following path in tsconfig: "@repo/ui/*": ["./*"]
. However, in tanstack start there seem to be issues.10 Replies
puzzled-coralOP•6mo ago
Might be useful

foreign-sapphire•6mo ago
what's your app.config.ts?
puzzled-coralOP•6mo ago
Ok so nevermind... You just told me enough haha.
Needed to add
../../packages/ui/tsconfig.json
to the array
Thanks!
However @Manuel Schiller , now I encounter some other issues.
Trying to define a server function:
foreign-sapphire•6mo ago
needs more context
ideally a complete example repository
like-gold•6mo ago
Im also interested in mono repo setup as I am trying to do something similar in pnpm
conventional-tan•6mo ago
I dont have this, why is that needed ?
puzzled-coralOP•6mo ago
For me it didn’t resolve paths @stunaz
that’s why i’ve added it
robust-apricot•6mo ago
Do you have any updates on this error?
It seems to me that it is a communication conflict between ts and pnpm workspaces. I "solved" it disabling "sourceMap", "composite" and "declaration" from my ts.config. But I don't know if it is the best solution (probably is not)
puzzled-coralOP•6mo ago
@Yam I didn’t have time to look more into it.
But thanks for letting me know
conventional-tan•6mo ago
for me its working locally just fine without any config, but when deploying to vercel, i have this error
