-
Notifications
You must be signed in to change notification settings - Fork 123
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: Can't use functions runnable on the server that are exported alongside client components #731
Comments
This is great suggestion! @roushou Thanks for the feedback. We're on it. 🫡 |
I can help if needed. Just need to make sure we are aligned regarding which path to take. |
I guess @roushou, there is an interesting question here which is:
I ask this question because I wonder if we should have a So the meta question, is how we split between:
|
Describe the bug and the steps to reproduce it
This is related to an issue someone had on Discord https://discord.com/channels/1220414409550336183/1255514874860273708
Currently, module entrypoints export both functions runnable on the server and client components which makes Next.js not happy.
Here's a reproduction https://stackblitz.com/edit/stackblitz-starters-bmjcpd?file=app%2Fpage.tsx
Server components enable to do server-side actions directly inside React components, i.e.
FWIW I'm not really fan of this but that's the direction things are heading.
So there are issues when trying to use things like
getAttestations()
in server components because@coinbase/onchainkit/identity
also exports client components.This should be fixable by separating exports to something like
@coinbase/onchainkit/<module>/core
and@coinbase/onchainkit/<module>/react
@coinbase/onchainkit/<module>/core
and@coinbase/onchainkit/<module>
which exports components@coinbase/onchainkit/core
for all server side functions and@coinbase/onchainkit/<module>
for client componentsI find the 3rd option more intuitive as a consumer because of the clear distinction.
What's the expected behavior?
No response
What version of the libraries are you using?
0.23.2
The text was updated successfully, but these errors were encountered: