-
Notifications
You must be signed in to change notification settings - Fork 6
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
Statery is broken in Next.js #30
Comments
Temporary workaround is just to rollback to v0.6.3. |
Thanks, I'll take a look. I might need a little bit of time until I get around to it as I'm about to start a new job, but I'll try. Thank you very much for the detailed report, and all the extra links to how other projects tackled it. (Pinging @smartinio, simply because we were discussing this change a while ago and weren't sure what the repercussions would be.) Anyone encountering this bug, please use version |
@hmans Created a PR with a fix and a server-side test. Verified locally that it works as well. @daveschumaker Feel free to test it on your end too. |
Nice work! I imported it into my Next JS v13 app and it works in both SSR and client contexts. Thanks for tackling this! |
Sweet, no worries! Not sure how I ended up tagging you @daveschumaker but I meant to tag the OP @trezy 😅 |
@smartinio Yup, looks great! I tested it locally and it works like a dream. 😁 |
Thanks everyone for jumping in, especially @smartinio for the PR! |
I tried using Statery in a fresh Next.js app and encountered this error...
I've already tracked down the issue: updating to
useSyncExternalStore
(issue #9 and PR #27). More specifically, the issue is that Statery isn't providing a 3rd argument to the hook,getServerSnapshot
.Now, React states that this 3rd argument is optional, and in the error message states that it will revert to client rendering. Next.js should be reverting to client rendering for the affected components, but it's not. As a result, this error prevents anything from being loaded at all.
Ideally, this issue should be fixed in Next.js so that nobody encounters it again. I've created an issue on that repo to track as well, but I expect it'll take quite some time before we see a fix. I'm hoping we can come up with a solution specifically for Statery in the meantime.
FWIW, several other projects have encountered and solved this same issue, so it's not exactly novel. I'll link to a handful of issues/commits where it was discussed/fixed elsewhere.
react-rxjs
The text was updated successfully, but these errors were encountered: