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
fix(nuxt): stringify cookie values before broadcasting them #23449
Conversation
Run & review this pull request in StackBlitz Codeflow. |
This PR will be squashed right? I'd force push to avoid the little commits fixing my debugging artifacts if not |
Yes, the pr will be squashed. I guess I'm thinking that the encoder has to produce a string to save the cookie. (It won't be undefined as we have defaults.) |
Thank you β€οΈ |
@danielroe I noticed you removed the ternary. This could theoretically lead to Not sure if thats something this should really worry about as it would clearly be the users fault, but it's theoretically possible, so I wanted to mention it :) |
Ah, you're right. I initially thought it would error if the user did that, but I think implementation in I think this is likely an edge case but if you want to, we could also cover this scenario. I just don't want to add too much runtime code to cover this scenario. |
Has this actually been merged? I'm still facing the issue on the latest nuxt release:
|
It was released in Nuxt 3.8. Are you sure the log you linked is related to this code, and not another issue in the supabase module? |
@danielroe I'm not sure, it could be a supabase issue. It's hard to determine what really causes this issue, I'm not sure how to even provide a reproduction. I'lll also bring this up on the supabase repo, and see if we can find a specific cause. |
π Linked issue
#21651
β Type of change
π Description
Resolves #21651 by preparing the cookie value for the structuredClone that's used by
BroadcastChannel.postMessage
.It does this simply by cloning the value which might potentially hold nested Refs.
toRaw
unfortunately only applies to the root Ref, not to any nested Refs.π Checklist