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:
@@ -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 };
|
||||||
|
|||||||
Reference in New Issue
Block a user