fix(live-preview): fallback serverURL to localhost instead of empty string
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions

postMessage with empty string origin throws "Invalid target origin ''"
Use same fallback as payload.config.ts — http://localhost:3000.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-05-15 18:46:55 +01:00
parent 1defcc13b0
commit 965ffc2084

View file

@ -8,7 +8,7 @@ export function RefreshRouteOnSave() {
return (
<PayloadLivePreview
refresh={() => router.refresh()}
serverURL={process.env.NEXT_PUBLIC_SITE_URL ?? ''}
serverURL={process.env.NEXT_PUBLIC_SITE_URL ?? 'http://localhost:3000'}
/>
)
}