Skip to content

Commit 2058b25

Browse files
committed
Add check for "window" variable on client side
1 parent 7c0f196 commit 2058b25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/assets.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ export const getStaticProps = (async ({ locale }) => {
142142
const AssetsPage = () => {
143143
// Ignore locale in the URL for SVG path in public directory to fix broken link
144144
// SVG path changes from /en/images => /images
145-
const svgPathFromOrigin = window.location.origin
145+
const svgPathFromOrigin =
146+
typeof window !== `undefined` ? window.location.origin : ""
146147

147148
const { t } = useTranslation("page-assets")
148149
const assetPageHeroImage = useColorModeValue(

0 commit comments

Comments
 (0)