Skip to content

Dev-mode warning: Warning: Only plain objects can be passed to Client Components from Server Components. Classes or other objects with methods are not supported. #332

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

Open
phryneas opened this issue Jul 17, 2024 · 2 comments

Comments

@phryneas
Copy link
Member

phryneas commented Jul 17, 2024

This seems to be caused by queryRef.toPromise().

I'd love to keep the function in there in the long term, but we might need to ask the React team to make that possible. Meanwhile I'll probably (temporarily?) remove the function.

(Reported in Discord)

@thomaswelton
Copy link

@phryneas I've been look at the integration with react router https://www.npmjs.com/package/@apollo/client-integration-react-router

It's looking pretty good, but can see that queryRef.toPromise() has been disabled.
Looking at the comments it seems this was disabled due to issues with RSC. Was this problem specific to the next js integraton. And is it possible to bring this feature back so it could be used with react router 7?

@phryneas
Copy link
Member Author

We might be able to bring it back, but really it depends if we can somehow hide it from React-Router's serialization.

As that might be difficult, we might also need to create a completely different API for that, so maybe something like preloader.toPromise(queryRef).

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

2 participants