stop pre-building activity pages to fix OOM build failure

getStaticPaths now returns [] — all /activity/{id}/ URLs are served by
the activity/index.html shell via nginx try_files and hydrated by
ActivityDetailLoader. Pre-rendering thousands of pages was exhausting
server RAM and killing the build. The dynamic loader already handles
public, unlisted, and local activities identically.
This commit is contained in:
Davide Scaini
2026-04-14 22:22:34 +02:00
parent 13643479ef
commit 8fbd9a95e8
+10
View File
@@ -6,6 +6,15 @@ import ActivityDetail from '../../components/ActivityDetail.svelte';
import type { BASIndex, ActivitySummary, AthleteZones } from '../../lib/types'; import type { BASIndex, ActivitySummary, AthleteZones } from '../../lib/types';
export async function getStaticPaths() { export async function getStaticPaths() {
// Activity pages are not pre-built — all /activity/{id}/ URLs are served
// by the activity/index.html shell via nginx try_files and loaded dynamically
// by ActivityDetailLoader. Pre-building thousands of pages at build time
// exhausts server memory. The shell handles public, unlisted, and local
// activities identically with no loss of functionality.
return [];
// Dead code below — kept for reference only.
/* eslint-disable no-unreachable */
try { try {
const candidates = [ const candidates = [
process.env.BINCIO_DATA_DIR, process.env.BINCIO_DATA_DIR,
@@ -119,6 +128,7 @@ export async function getStaticPaths() {
} catch { } catch {
return []; return [];
} }
/* eslint-enable no-unreachable */
} }
const { activity, athlete } = Astro.props as { activity: ActivitySummary; athlete: AthleteZones | null }; const { activity, athlete } = Astro.props as { activity: ActivitySummary; athlete: AthleteZones | null };