Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
achtan opened this issue Sep 22, 2024 · 2 comments

Comments

@achtan
Copy link

achtan commented Sep 22, 2024

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:

  • clone repo
  • pnpm i
  • open the packages/api/src/trpc.ts file

Additional information

No response

@matheins
Copy link

Same issue for me

@juliusmarminge
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants