Skip to content

fix(next): static live preview url corrupt after save - #13949

Merged
jacobsfletch merged 3 commits into
mainfrom
fix/static-lp-url
Sep 26, 2025
Merged

jacobsfletch merged 3 commits into
mainfrom
fix/static-lp-url

Conversation

@jacobsfletch

@jacobsfletch jacobsfletch commented Sep 26, 2025 •

Copy link
Copy Markdown
Member

As of #13631, statically defined live preview URLs become corrupt after the first save.

For example, if you define your URL as a string like this:

import type { CollectionConfig } from 'payload'

const MyCollection: CollectionConfig = {
  // ...
  admin: {
    livePreview: {
      url: '/hello-world'
    }
  }
}

On initial load, the iframe's src will evaluate to .../hello-world as expected, but from the first save onward, the url becomes .../undefined.

This is because for statically defined URLs, the livePreviewURL property does not exist on the response. Despite this, we set it into state as undefined. This is true for both collections and globals.

Initially reported on Discord here: https://discord.com/channels/967097582721572934/967097582721572937/1421166976113442847


@jacobsfletch jacobsfletch changed the title fix(next): static live preview urls overridden on save fix(next): static live preview urls corrupt on save Sep 26, 2025
@github-actions

github-actions Bot commented Sep 26, 2025 •

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@jacobsfletch
jacobsfletch marked this pull request as ready for review September 26, 2025 19:51
@jacobsfletch jacobsfletch changed the title fix(next): static live preview urls corrupt on save fix(next): static live preview url corrupt after save Sep 26, 2025
@jacobsfletch
jacobsfletch enabled auto-merge (squash) September 26, 2025 21:13
@jacobsfletch
jacobsfletch merged commit 3c4f8a3 into main Sep 26, 2025
@jacobsfletch
jacobsfletch deleted the fix/static-lp-url branch September 26, 2025 21:23
@github-actions

Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.58.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants