I ran into this bug where I was getting a duplicate robots tag which was causing one of my sites to not be indexed. This isn't new, you can read about the bug here.

The discussion was closed but this is still happening in 14.0.3.

The fix, like described in the Github issue linked above, is to use the native URLSearchParams with `window.location.search` instead of the `useSearchParams` hook.

const searchParams = new URLSearchParams(typeof window !== "undefined" ? window.location.search : "");