diff --git a/apps/web/components/seo/head-seo.tsx b/apps/web/components/seo/head-seo.tsx index 3495d4e731..cef2b8e75e 100644 --- a/apps/web/components/seo/head-seo.tsx +++ b/apps/web/components/seo/head-seo.tsx @@ -8,10 +8,10 @@ import { constructMeetingImage, MeetingImageProps, } from "@calcom/lib/OgImages"; -import { truncate, truncateOnWord } from "@calcom/lib/text"; +import { getBrowserInfo } from "@calcom/lib/browser/browser.utils"; +import { truncateOnWord } from "@calcom/lib/text"; import { getSeoImage, seoConfig } from "@lib/config/next-seo.config"; -import { getBrowserInfo } from "@lib/core/browser/browser.utils"; export type HeadSeoProps = { title: string; diff --git a/apps/web/lib/core/browser/browser.utils.ts b/apps/web/lib/core/browser/browser.utils.ts deleted file mode 100644 index aa91353009..0000000000 --- a/apps/web/lib/core/browser/browser.utils.ts +++ /dev/null @@ -1,20 +0,0 @@ -type BrowserInfo = { - url: string; - path: string; - referrer: string; - title: string; - query: string; -}; - -export const getBrowserInfo = (): Partial => { - if (!process.browser) { - return {}; - } - return { - url: window.document.location?.href ?? undefined, - path: window.document.location?.pathname ?? undefined, - referrer: window.document?.referrer ?? undefined, - title: window.document.title ?? undefined, - query: window.document.location?.search, - }; -}; diff --git a/packages/lib/browser/browser.utils.ts b/packages/lib/browser/browser.utils.ts index aa91353009..93da69640c 100644 --- a/packages/lib/browser/browser.utils.ts +++ b/packages/lib/browser/browser.utils.ts @@ -7,7 +7,7 @@ type BrowserInfo = { }; export const getBrowserInfo = (): Partial => { - if (!process.browser) { + if (typeof window === "undefined") { return {}; } return {