[go: up one dir, main page]

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 subscription payload on the onData callback for the useSubscription hook has type "any" in release v11.0.0-rc.637 and above (633 works) #6243

Open
1 task
tokenosopher opened this issue Nov 16, 2024 · 1 comment

Comments

@tokenosopher
Copy link
tokenosopher commented Nov 16, 2024

Provide environment information

System:
OS: macOS 15.0.1
CPU: (8) arm64 Apple M3
Memory: 428.25 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
pnpm: 9.11.0 - ~/.nvm/versions/node/v20.17.0/bin/pnpm
Browsers:
Safari: 18.0.1
npmPackages:
@tanstack/react-query: ^5.59.15 => 5.60.2
@trpc/client: next => 11.0.0-rc.638+09a76869e
@trpc/react-query: next => 11.0.0-rc.638+09a76869e
@trpc/server: next => 11.0.0-rc.638+09a76869e
next: ^15.0.2 => 15.0.3
react: ^18.3.1 => 18.3.1
typescript: ^5.6.2 => 5.6.3

Describe the bug

You can run the examples-next-see-chat to reproduce - I see the same behaviour on my project as well.

The payload has the right type in rc.633 and lower, but anything above it has type any. I will revert to version 633 until this gets resolved, but thought I'd flag.

Link to reproduction

https://github.com/trpc/examples-next-sse-chat

To reproduce

Clone the examples-next-sse-chat repo, go to src/app/channels/[channelId]/hooks.ts and check the type for the onData payload - you will see it's of type "any".

How to patch: downgrade trpc to 11.0.0-rc.633, you will see it has the correct type.

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR fixing this bug!

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar
@KATT
Copy link
Member
KATT commented Nov 17, 2024

Pro due to fixing #6226

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

No branches or pull requests

2 participants