From c18782b7aa7455a89176615ddeb370968f895f75 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 16 Aug 2022 00:51:05 +0200 Subject: [PATCH] fix: limit redirects to browser context Build breaks because there is no window during server build --- src/.vuepress/theme/layouts/Layout.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/.vuepress/theme/layouts/Layout.vue b/src/.vuepress/theme/layouts/Layout.vue index 88dd1587..abac24bc 100644 --- a/src/.vuepress/theme/layouts/Layout.vue +++ b/src/.vuepress/theme/layouts/Layout.vue @@ -10,6 +10,9 @@ export default { name: 'Layout', beforeCreate() { + if (!process.browser) { + return; + } // redirect blog.ipfs.io → blog.ipfs.tech (incl. gateways) // https://github.com/ipfs/ipfs-blog/issues/417 const { href } = window.location