-
Notifications
You must be signed in to change notification settings - Fork 13
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: Fixes a server client boundary error #3917
Conversation
🧪 Review environmenthttps://annkiztqr2gm73n5wjwsxxtwha0pomae.lambda-url.ca-central-1.on.aws/ |
const existingFlow = useRef<{ email?: string; authenticationFlowToken?: string; error?: string }>( | ||
{} | ||
); | ||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really wanted to use the new React hook use()
but ran into some errors and an open bug. I wasn't able to find a work around so I sadly went with the old style.
For reference:
facebook/react#26930
and then this
vercel/next.js#51477
@thiessenp-cds can you add test instructions ? |
This is a difficult one to test. The error only happens sometimes and manually throwing an error etc. won't really help since it's a hydration related. For this fix, I think all we can do is test that it doesn't break anything. (still works) |
This error was probably happening because somewhere on our site we are still using a standard |
:) Can just test by visiting https://localhost:3000/en/auth/mfa/resend direct |
Summary | Résumé
Fixes a prod error where NextJS tried to server render some client code. Here is the prod error for reference: "ReferenceError: sessionStorage is not defined"
Test
One way to test this is to programmatically trigger the MFA page to sever side render (See Bryan's comment below).
Do this by:
Reproduce the error
Verify the error is gone
fix/3915
(this branch) and add the button like in the above