1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 14:06:40 -04:00

marginally better error logging

This commit is contained in:
2025-03-06 13:25:21 -05:00
parent f7d5413165
commit 8b2e513ca9
6 changed files with 31 additions and 44 deletions

View File

@ -19,7 +19,8 @@ const HitCounter = async ({ slug }: { slug: string }) => {
// we have data!
return <span title={`${commaNumber(hits)} ${hits === 1 ? "view" : "views"}`}>{commaNumber(hits)}</span>;
} catch (error) {
console.error(error);
console.error("[hit counter] fatal error:", error);
throw new Error();
}
};

View File

@ -117,7 +117,7 @@ export default async function Page({ params }: { params: Promise<{ slug: string
</div>
{/* only count hits on production site */}
{process.env.NEXT_PUBLIC_VERCEL_ENV === "production" && (
{process.env.NEXT_PUBLIC_VERCEL_ENV !== "development" && process.env.NODE_ENV !== "development" ? (
<ErrorBoundary fallback={null}>
<div
className={styles.metaItem}
@ -133,7 +133,7 @@ export default async function Page({ params }: { params: Promise<{ slug: string
</Suspense>
</div>
</ErrorBoundary>
)}
) : null}
</div>
<h1 className={styles.title}>