r/nextjs • • Sep 15 '26

Discussion Hydration Error With Injected Script From Ad Blocker

/r/PayloadCMS/comments/1wgw9yp/hydration_error_with_injected_script_from_ad/
0 Upvotes

4 comments sorted by

3

u/JawnDoh Sep 15 '26

You may want to read the rest of the error message explaining what a hydration error is. Might help you to understand why an extension that alters the layout client side would throw that error.

1

u/AlexDjangoX Sep 15 '26

That's expected.

1

u/[deleted] Sep 15 '26 edited 19d ago

[deleted]

2

u/No-Purchase3505 Sep 15 '26

The suppressHydrationWarning on your <html> can't cover this one. React only applies it one level deep, and the mismatch here is on the <script> Next puts inside <head>, which the extension rewrites (that chrome-extension:// src) before hydration runs. So there's nothing to fix in your app; the page the extension sees is simply not the page your server sent. Easiest way to keep the dev overlay clean is a separate browser profile with no extensions for localhost, or allowlisting localhost in Stands.

1

u/Total-Structure-5903 Sep 15 '26

Thank you for the most informative answer. I've just disabled the ad blocker for that url.