tRPCttRPC
Powered by
jgouxJ
tRPCβ€’3y agoβ€’
23 replies
jgoux

Am I the only one struggling with pnpm + TypeScript monorepo + trpc?

Hello all,

When using pnpm in a TypeScript monorepo without
node-linker
node-linker
, I hit those errors:

web/src/lib/trpc.tsx:7:14 - error TS2742: The inferred type of 'trpc' cannot be named without a reference to '../../../api/node_modules/@snaplet/sdk/src'. This is likely not portable. A type annotation is necessary.

7 export const trpc = createReactQueryHooks<WebRouter>()
web/src/lib/trpc.tsx:7:14 - error TS2742: The inferred type of 'trpc' cannot be named without a reference to '../../../api/node_modules/@snaplet/sdk/src'. This is likely not portable. A type annotation is necessary.

7 export const trpc = createReactQueryHooks<WebRouter>()


Types sharing between packages when using pnpm + TypeScript is quite broken, and I'm not sure what's the best move to solve it. Ideally I shouldn't have to alter my
compilerOptions.paths
compilerOptions.paths
, or install extra deps in the root. πŸ˜…

I opened a discussion about it here if you want to participate: https://github.com/orgs/pnpm/discussions/6367
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

trpc in a pnpm monorepo
JZuberoJJZubero / ❓-help
3y ago
Trpc in monorepo with microservices
KimblisKKimblis / ❓-help
2y ago
Prisma+TRPC monorepo
KimblisKKimblis / ❓-help
4y ago