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

NextJS 13 getServerSnapshot issue #305

Closed
CMCDragonkai opened this issue Aug 2, 2023 · 3 comments · Fixed by #306
Closed

NextJS 13 getServerSnapshot issue #305

CMCDragonkai opened this issue Aug 2, 2023 · 3 comments · Fixed by #306

Comments

@CMCDragonkai
Copy link

When using react-rxjs inside a nextjs client component, I see this on the server sometimes:

- error Error: Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.

There's a similar issue on zustand: pmndrs/zustand#886.

I only saw this error when I started using react-rxjs, seems to apply to state/hook related libraries? I'm not entirely sure why it would occur when I start using react-rxjs.

@voliva
Copy link
Collaborator

voliva commented Aug 4, 2023

Hey, thank you for raising this issue. Currently looking for some options.

I only saw this error when I started using react-rxjs, seems to apply to state/hook related libraries? I'm not entirely sure why it would occur when I start using react-rxjs.

Yes, useStateObservable (or the hook returned by bind) uses React's useSyncExternalStore, and this one emits this warning when it's not set up for SSR.

@CMCDragonkai
Copy link
Author

Nice!

@voliva
Copy link
Collaborator

voliva commented Aug 5, 2023

Fixed on 0.10.7

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

Successfully merging a pull request may close this issue.

2 participants