payloadcms / payloadcms/payload

[BUG] Edit views render blank on Cloudflare Pages - empty RSC Suspense boundaries

Open
#15,712 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug stale
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Description

Edit views in the Payload admin panel render completely blank when deployed to Cloudflare Pages using @opennextjs/cloudflare. The page loads (200 OK) but the form content is missing - only the header and navigation render. List views work correctly.

Environment

  • Payload Version: 3.77.0
  • @opennextjs/cloudflare: ^1.11.0 (resolves to 1.16.5)
  • Next.js: 15.4.11
  • Database: Cloudflare D1 with @payloadcms/db-d1-sqlite
  • Storage: Cloudflare R2 with @payloadcms/storage-r2
  • Platform: Cloudflare Pages (Workers)

Reproduction Steps

  1. Deploy a Payload CMS app to Cloudflare Pages using the official template configuration
  2. Log into the admin panel (login works fine)
  3. Navigate to any collection list view (works fine)
  4. Click on any document to edit it
  5. Result: Blank page with only header/navigation - no form fields render

Expected Behavior

Edit views should render the document form fields, allowing users to edit content.

Actual Behavior

Edit views render blank. The HTML response shows empty React Suspense boundaries:

<div hidden=""><!--$--><!--/$--></div>

This indicates the RSC (React Server Component) content is not streaming/rendering into the Suspense boundary.

Technical Analysis

  • List views work: The list view RSC renders correctly
  • Edit views don't: The edit view RSC returns empty Suspense markers
  • API works: Direct API calls to /api/collections/{collection}/{id} return correct data
  • Local dev works: next dev renders edit views correctly
  • All deployments affected: Both production and preview branches, including older deployments

Configuration Files

next.config.ts:

import { withPayload } from '@payloadcms/next/withPayload'

const nextConfig = {
  serverExternalPackages: ['jose', 'pg-cloudflare'],
  webpack: (webpackConfig: any) => {
    webpackConfig.resolve.extensionAlias = {
      '.cjs': ['.cts', '.cjs'],
      '.js': ['.ts', '.tsx', '.js', '.jsx'],
      '.mjs': ['.mts', '.mjs'],
    }
    return webpackConfig
  },
}

export default withPayload(nextConfig, { devBundleServerPackages: false })

wrangler.json:

{
  "name": "yoodel-flare2",
  "pages_build_output_dir": ".open-next",
  "compatibility_date": "2025-08-15",
  "compatibility_flags": ["nodejs_compat"],
  "d1_databases": [{ "binding": "D1", ... }],
  "r2_buckets": [{ "binding": "R2", ... }]
}

open-next.config.ts:

import { defineCloudflareConfig } from '@opennextjs/cloudflare/config'
export default defineCloudflareConfig({})

Related Issues

  • #14656 - Server Actions lose authentication in Cloudflare Workers environment
  • opennextjs/opennextjs-cloudflare#544 - Not working with PayloadCMS
  • opennextjs/opennextjs-cloudflare#336 - React suspense not working

Screenshots

The edit view shows only the header and navigation - the main content area where the form should be is completely empty.

Additional Context

This appears to be a fundamental issue with how RSC streaming works on Cloudflare Workers/Pages. The server component for the edit view either:

  1. Errors silently during render
  2. Cannot access authentication context
  3. Has a streaming/timeout issue specific to Cloudflare

The official Payload Cloudflare D1 template (https://github.com/payloadcms/payload/tree/main/templates/with-cloudflare-d1) uses the same configuration but may have the same issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the edit-view failure using the deployment setup in next.config.ts, wrangler.json, and open-next.config.ts, then compare its RSC response with a working list view. Trace why the edit view produces empty Suspense markers on Cloudflare Pages; done means deployed edit forms render their document fields while list views and authentication continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, react, typescript
Domain
cloud, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.