Problem Statement
When a page is in draft state (not yet published / not live) and is opened inside the Universal Visual Editor (UVE), the headless app shows a 404 instead of rendering the draft page.
The headless client uses a read-only token and on first load requests the LIVE version of the page, which does not exist yet, so the server returns 404. The consumer app treats that 404 as an error and throws, so DotCMSLayoutBody and the useEditableDotCMSPage hook never mount / initialize.
UVE then sends the correct draft page object via postMessage (UVEEventType.CONTENT_CHANGES), but because the hook and its UVE subscription were never set up, the message never arrives and the 404 stays on screen.
Root cause: The SDK wiring — specifically the useEditableDotCMSPage hook — is not designed to accept/tolerate an error response such as a 404. Inside the UVE editing context, a 404 for a non-live page is a valid intermediate state, not a fatal error.
- Affected file:
core-web/libs/sdk/react/src/lib/next/hooks/useEditableDotCMSPage.ts
- Type: Front-end (SDK
@dotcms/react)
- Impact: Editors cannot edit unpublished/draft pages in the Universal Visual Editor.
Steps to Reproduce
- Create a new page in dotCMS but do NOT publish it (leave it in draft).
- Open the page in the Universal Visual Editor (UVE).
- The headless app's first load requests the LIVE page with a read-only token and gets a 404.
- The app throws on the 404, so the hook never initializes; UVE's draft page object sent via
postMessage is never applied.
- Result: A 404 is shown instead of the editable draft page.
Acceptance Criteria
dotCMS Version
Latest from main branch (SDK @dotcms/react)
Severity
High - Major functionality broken
Links
Problem Statement
When a page is in draft state (not yet published / not live) and is opened inside the Universal Visual Editor (UVE), the headless app shows a 404 instead of rendering the draft page.
The headless client uses a read-only token and on first load requests the LIVE version of the page, which does not exist yet, so the server returns 404. The consumer app treats that 404 as an error and throws, so
DotCMSLayoutBodyand theuseEditableDotCMSPagehook never mount / initialize.UVE then sends the correct draft page object via
postMessage(UVEEventType.CONTENT_CHANGES), but because the hook and its UVE subscription were never set up, the message never arrives and the 404 stays on screen.Root cause: The SDK wiring — specifically the
useEditableDotCMSPagehook — is not designed to accept/tolerate an error response such as a 404. Inside the UVE editing context, a 404 for a non-live page is a valid intermediate state, not a fatal error.core-web/libs/sdk/react/src/lib/next/hooks/useEditableDotCMSPage.ts@dotcms/react)Steps to Reproduce
postMessageis never applied.Acceptance Criteria
useEditableDotCMSPage(and the SDK wiring) tolerates an initial error/404 response when running inside UVE instead of blocking initialization.postMessageflow instead of showing 404.dotCMS Version
Latest from main branch (SDK
@dotcms/react)Severity
High - Major functionality broken
Links