Closed andrecasal closed 1 year ago
Found the problem: the theme cookie is being set per page. Trying to find out when this happens.
Navigating to other pages overrides the first dark
cookie and sets a new one. I think this part is related to how Browsers work, not anything specific to our code. Brushing up on browser-handling cookie logic :)
Commented out useTheme()
and <ClientHintCheck />
on the root.tsx
, and the browser still shows page-specific cookies.
I think deleting all page-specific cookies fixes the issue. I'll close the issue for now and re-open if this happens again.
Found both this and https://github.com/epicweb-dev/epic-stack/issues/444 bug.
When you change your OS theme, Chrome sets a page-specific cookie:
Because the injected script can't handle duplicate cookie keys, it starts an infinite reloading cycle:
I see this was already fixed with 85d29f63b0d866638192a0f18650dfccf27db9ba
Here's the issue.
To reproduce:
Somehow the
CH-prefers-color-scheme
cookie is page-specific.Investigating this now.