-
Notifications
You must be signed in to change notification settings - Fork 69
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
toPlainMessage
doesn't work with RSC and messages that contain binary data (Uint8Array
)
#531
Comments
React Server Components require that all props are serializable to JSON. Your solution of passing the base64 encoded binary is valid, but you could probably simplify the process by just passing down the |
Yeah. I've used (My messages are basically small programs for remote execution with all sorts of metadata attached to them) |
Btw. I'm merely raising this issue because |
@srikrsna-buf, this should be resolved by #533, right? |
Yes it can be closed |
v1.3.1 has just been released with the fix. |
I tried to utilize
toPlainMessage
to pass theserver<>client
boundary in a Next.js application (with React Server Components, RSC).I ran into an obscure error there which appears to be caused by my messages containing WASM code (binary as
Uint8Array
).I confirmed that "rehydrating" the same message (once via binary, once via plain message) doesn't yield the same result:
However, it works fine for me if I use
.toBinary()
on the server and then "rehydrated" on the client using serde utils like this (using base64 to optimize for wire size):The text was updated successfully, but these errors were encountered: