From 9370121cd40e7f9f9ee2c212428b6460a078638b Mon Sep 17 00:00:00 2001 From: Onurcankaratay Date: Thu, 3 Oct 2024 14:49:31 +0300 Subject: [PATCH] Temporarily handle uncaught exceptions related to hydration --- .../post_deploy_testing/cypress/support/e2e.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/deploy/post_deploy_testing/cypress/support/e2e.js b/deploy/post_deploy_testing/cypress/support/e2e.js index 0e7290a13d..8faef5a814 100644 --- a/deploy/post_deploy_testing/cypress/support/e2e.js +++ b/deploy/post_deploy_testing/cypress/support/e2e.js @@ -17,4 +17,18 @@ import './commands' // Alternatively you can use CommonJS syntax: -// require('./commands') \ No newline at end of file +// require('./commands') + +Cypress.on("uncaught:exception", (err) => { + // TODO: Investigate hydration errors occurring during SSR in Cypress tests. + // It appears that Cypress injects a prop into the div on the client side, which doesn't exist on the server side, leading to hydration issues. + // This suppression is temporary and should be removed once the issue is resolved. + // https://github.com/cypress-io/cypress/issues/27204 + if ( + /hydrat/i.test(err.message) || + /Minified React error #418/.test(err.message) || + /Minified React error #423/.test(err.message) + ) { + return false; + } +}); \ No newline at end of file