diff --git a/apps/nextjs/package.json b/apps/nextjs/package.json index cb3f9b643..029758c8d 100644 --- a/apps/nextjs/package.json +++ b/apps/nextjs/package.json @@ -73,7 +73,7 @@ "concurrently": "^8.2.2", "eslint": "^8.57.0", "prettier": "^3.2.5", - "tsx": "4.10.5", + "tsx": "4.11.0", "typescript": "^5.4.5" }, "eslintConfig": { diff --git a/apps/nextjs/src/components/layout/analytics.tsx b/apps/nextjs/src/components/layout/analytics.tsx index 76e76e2d2..322d7a0a6 100644 --- a/apps/nextjs/src/components/layout/analytics.tsx +++ b/apps/nextjs/src/components/layout/analytics.tsx @@ -4,9 +4,10 @@ import { UMAMI_WEBSITE_ID } from "@homarr/analytics"; import { api } from "@homarr/api/server"; export const Analytics = async () => { - const analytics = await api.serverSettings.getAnalytics(); + // For static pages it will not find any analytics data so we do not include the script on them + const analytics = await api.serverSettings.getAnalytics().catch(() => null); - if (analytics.enableGeneral) { + if (analytics?.enableGeneral) { return