Next.js Hydration error happening only in production.
There is a bug I've been trying to solve on the website I work at. There is one specific page that triggers an hydration error:
https://reactjs.org/docs/error-decoder.html/?invariant=418
https://reactjs.org/docs/error-decoder.html/?invariant=425
The main issue is that it only happens in production. On top of that, it only triggers when I directly access the page, or refresh it. If I'm at the home page, for example, and navigate to the page that triggers this error, it will not happen.
I've done a bit of research and this matches what is happening to me:
https://www.reddit.com/r/nextjs/comments/wlmkz6/hydration_errors_on_production_only/
However, I did modify all the localisation functions used in the application to just return an empty string and sent it to our staging / tests deployed site, and the issue was still happening.
The major issue is that this keeps firing sentry errors, clogging up the logs, and even reaching the errors limit quota available for the plan.
Since this doesn't happen in development mode, I'm a bit lost about how to actually trace the issue and fix it. So I'd just like to ask for some different ideas about how I can approach this issue.
https://reactjs.org/docs/error-decoder.html/?invariant=418
https://reactjs.org/docs/error-decoder.html/?invariant=425
The main issue is that it only happens in production. On top of that, it only triggers when I directly access the page, or refresh it. If I'm at the home page, for example, and navigate to the page that triggers this error, it will not happen.
I've done a bit of research and this matches what is happening to me:
https://www.reddit.com/r/nextjs/comments/wlmkz6/hydration_errors_on_production_only/
However, I did modify all the localisation functions used in the application to just return an empty string and sent it to our staging / tests deployed site, and the issue was still happening.
The major issue is that this keeps firing sentry errors, clogging up the logs, and even reaching the errors limit quota available for the plan.
Since this doesn't happen in development mode, I'm a bit lost about how to actually trace the issue and fix it. So I'd just like to ask for some different ideas about how I can approach this issue.


