How to fix hydration errors in Next.js?

Viewed 27

I'm receiving these two errors, but it doesn't tell me where to fix this problem

https://reactjs.org/docs/error-decoder.html/?invariant=418

https://reactjs.org/docs/error-decoder.html/?invariant=423

enter image description here

[Update] it looks like the error is in here

(b=3!==a.tag)&&!(b=5!==a.tag)&&(b=a.type,b="head"!==b&&"body"!==b&&!Ef(a.type,a.memoizedProps));if(b&&(b=yg)){if(Dg(a))throw Hg(),Error(p(418));for(;b;)Ag(a,b),b=Lf(b.nextSibling)}Fg(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(p(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if("/$"===c){if(0===b){yg=Lf(a.nextSibling);break a}b--}else"$"!==c&&"$!"!==c&&"$?"!==c||b++}a=a.nextSibling}yg=

enter image description here

1 Answers

It tells you how to fix the problem: you should fix it (running minified react without sourcemaps) before you can see the error in your code.

The links you are given are accurate.

Related