t3-oss / create-t3-turbo

Clean and simple starter repo using the T3 Stack along with Expo React Native
https://turbo.t3.gg
MIT License
4.57k stars 384 forks source link

bug: The inferred type of createTRPCContext cannot be named without a reference #1191

Open achtan opened 1 week ago

achtan commented 1 week ago

Provide environment information

System: OS: macOS 14.6.1 CPU: (12) arm64 Apple M2 Max Memory: 104.30 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm pnpm: 9.7.1 - ~/.nvm/versions/node/v18.20.2/bin/pnpm bun: 1.1.12 - ~/.bun/bin/bun Watchman: 2024.04.08.00 - /opt/homebrew/bin/watchman

Describe the bug

TS2742: The inferred type of createTRPCContext cannot be named without a reference to ../../../ node_modules/@clerk/ nextjs/ dist/ types/ server/ protect. This is likely not portable. A type annotation is necessary.

Screenshot 2024-09-22 at 13 33 01

Link to reproduction

https://github.com/achtan/3turbo

To reproduce

I just added the auth method from @clerk/nextjs to the TRPC context and the TS started complaining.

steps:

Additional information

No response

matheins commented 6 days ago

Same issue for me

juliusmarminge commented 2 days ago

Seems like a Clerk issue that they're not exporting enough types. Add a type annotation to isomorphicGetSession like the message suggests