Skip to content

fix: Fix header hydration issue & insert debug for footer#1370

Merged
rschristian merged 1 commit intomasterfrom
fix/hydration
Jan 9, 2026
Merged

fix: Fix header hydration issue & insert debug for footer#1370
rschristian merged 1 commit intomasterfrom
fix/hydration

Conversation

@rschristian
Copy link
Member

Closes #1369

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

Size Change: -6 B (0%)

Total Size: 443 kB

ℹ️ View Unchanged
Filename Size Change
build/assets/blog-page-********.js 256 B 0 B
build/assets/docsearch-********.js 28.9 kB +1 B (0%)
build/assets/errors-********.js 342 B 0 B
build/assets/index-********.css 9.65 kB 0 B
build/assets/index-********.js 27.3 kB -5 B (-0.02%)
build/assets/repl-********.css 1.51 kB 0 B
build/assets/repl-********.js 148 kB -1 B (0%)
build/assets/repl-page-********.js 7.65 kB -1 B (-0.01%)
build/assets/repl.worker-********.js 213 kB 0 B
build/assets/style-********.css 3.07 kB 0 B
build/assets/style.module-********.js 159 B 0 B
build/assets/tutorial-page-********.css 1.76 kB 0 B
build/assets/tutorial-page-********.js 1.97 kB 0 B

compressed-size-action

Comment on lines -136 to -145
{typeof window !== 'undefined' &&
Object.entries(config.locales).map(([id, label]) => (
<button
class={cx(id == lang && style.current)}
data-value={id}
onClick={e => setLang(e.currentTarget.dataset.value)}
>
{label}
</button>
))}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, I added the window check as we used to just roll with the hydration error as language was set during first render. A while back I fixed that so it's set in an effect after rendering, fixing the hydration issue, but evidently forgot to update this use here.


const translations = useResource(() => {
if (lang == 'en') return Promise.resolve(englishTranslations);
if (lang == 'en') return englishTranslations;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a bug in how we hydrate suspense boundaries, the app shouldn't be falling over here. Not something I have time to dig too deep into though. A plain return works just as well for our needs.

@rschristian rschristian marked this pull request as ready for review January 9, 2026 05:55
@rschristian rschristian merged commit 17892a8 into master Jan 9, 2026
5 checks passed
@rschristian rschristian deleted the fix/hydration branch January 9, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate page content rendering on documentation site

2 participants