Skip to content

Commit 6a08009

Browse files
iclantonclaude
andcommitted
Fix SSR crash: guard window.devicePixelRatio access in PeopleGrid
The constant at module scope accessed window.devicePixelRatio, which throws ReferenceError during Docusaurus server-side rendering in Node.js. Added typeof window check so it safely defaults to 100 during SSR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c2ef42d commit 6a08009

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

websites/rushstack.io/src/components/PeopleGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface IGitHubCardProps {
77
}
88

99
const gitHubBaseUrl = 'https://github.com/';
10-
const size: number = window.devicePixelRatio >= 2 ? 200 : 100;
10+
const size: number = typeof window !== 'undefined' && window.devicePixelRatio >= 2 ? 200 : 100;
1111

1212
/**
1313
* Returns GitHub profile and avatar URLs for a given alias.

0 commit comments

Comments
 (0)