React error in AWS Cognito hosted UI - why and how to bypass #31244
Unanswered
tv80
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My angular 19 app uses angular-auth-oidc-client and Cognio hosted UI to implement login with Cognito. My cypress login test uses almost the same sample code
cypress/support/auth-provider-commands/cognito.ts
found here: https://docs.cypress.io/app/guides/authentication-testing/amazon-cognito-authentication#Login-with-cyoriginThe login test basically worked, but now and then failed by the errors "Minified React error #418" (Hydration failed because the server rendered HTML didn't match the client.) generated by the Cognito hosted UI:

I never saw this error in real browsers outside cypress.
The same
Minified React error #418
happened in both "cypress open" and "cypress run", in both cypress local and cypress in github Actions, in both Chrome and Electron, in Windows as well as in WSL.What also annoys me is it happened randomly and not always. Before, I just reran the failed test and pipeline passed. But recently it has happened more often.
While running "cypress open" and the test failed by the mentioned error, I could actually manually login the test user successfully in the still-opened browser. This made me think even though the cause of the error is not understood, my test could just bypass the error and go on. So I've tried to installed a handler to catch the exception as guided by https://docs.cypress.io/api/cypress-api/catalog-of-events#Uncaught-Exceptions
That is, my login command became:
Now, whenever the error occurred, the uncaught:exception handler could catch some, but not all (of the same) errors.

I am at my end to explain this output.
Did anyone encounter a similar issue and could kindly give me a hint?
Beta Was this translation helpful? Give feedback.
All reactions