Skip to content

Conversation

@sc-shakyawijerathne
Copy link
Contributor

Description / Motivation

This PR fixes a critical build error that occurred during Vercel deployments when multiple XM Cloud sites share the same instance.

Root Cause

During static site generation (SSG), the generateStaticParams function was attempting to prerender pages for ALL sites in the XM Cloud instance, not just the site being deployed. For example, when deploying the SYNC site, it would incorrectly attempt to prerender pages from the Alaris site, causing build failures.

Solution

Modified the generateStaticParams function across all example starters to filter sites based on the defaultSite configuration in sitecore.config. The implementation now:

  • Checks if a defaultSite is configured
  • Filters the sites array to only include the configured site
  • Falls back to all sites if no defaultSite is specified

This ensures each starter only generates static params for pages that belong to its designated site, preventing cross-site build errors when multiple starters share the same XM Cloud instance.

Testing Details

  • Unit Test Added
  • Manual Test/Other

Testing Performed:

Verified successful Vercel deployments for individual starters in a shared XM Cloud environment
Confirmed static params generation only includes pages from the configured defaultSite

@sc-chathumikaalwis sc-chathumikaalwis deleted the branch Sitecore:release/CSDK-1.3.0 December 12, 2025 05:12
@sc-shakyawijerathne sc-shakyawijerathne changed the base branch from dmz to release/CSDK-1.3.0 December 12, 2025 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants