You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
templates/with-cloudflare-d1: storage config key doesn't exist in released 3.x — R2 never applied and admin crashes with "Functions cannot be passed directly to Client Components" #17195
That config key does not exist in released Payload 3.x. I verified against [email protected]: there is no reference to a storage key anywhere in the config build/sanitize code under node_modules/payload/dist. It appears to be an unreleased API that only exists on main, while the template's package.json pins released 3.x versions — so anyone scaffolding the template today gets a broken combination.
Three consequences on released versions:
r2Storage is silently never applied. Uploads fall back to local disk storage, which breaks on Cloudflare Workers (no writable filesystem).
The admin panel crashes entirely. The unknown storage key (containing plugin functions) is passed through to the client config, and every admin page — including /admin/login and /admin/create-first-user — dies with:
Error: Functions cannot be passed directly to Client Components
(observed digest: 4235013658)
payload generate:importmap omits R2ClientUploadHandler, since the plugin is never registered.
Workaround / suggested fix
Registering the adapter via plugins instead fixes all three:
After this change the admin panel loads, R2 uploads work on Workers, and payload generate:importmap emits R2ClientUploadHandler as expected.
Suggestion: either switch the template to plugins: [], or pin the template's dependencies to a Payload version where the storage config key actually exists.
(The unmodified template is the reproduction — no extra code needed.)
Reproduction Steps
npx degit payloadcms/payload/templates/with-cloudflare-d1 repro && cd repro
pnpm install
pnpm dev
Open http://localhost:3000/admin
Every admin route (login, create-first-user) crashes with Functions cannot be passed directly to Client Components.
Additionally note that pnpm payload generate:importmap produces an import map without R2ClientUploadHandler, and no R2 upload handling is wired up.
Which area(s) are affected?
area: templates, plugin: storage-*, db: d1-sqlite
Environment Info
payload: 3.82.1 (as pinned by the template; `storage` key also verified absent in 3.85.2)
@payloadcms/db-d1-sqlite: 3.82.1
@payloadcms/storage-r2: 3.82.1
@payloadcms/next: 3.82.1
next: 15.4.11 (template default)
node: v26.3.1
pnpm: 10.33.0
OS: macOS (darwin 25.5.0)
We are now pointing the One Click deployment button to Cloudflare to 3.x (17612) until v4 releases which correctly uses plugins for the pinned Payload version in that template.
Activity
Fix admin panel crash by registering R2 storage as a plugin
fix(templates): fix with-cloudflare-d1 build and bump dependencies (#…
nathanlentz commentedon Aug 3, 2026
We are now pointing the One Click deployment button to Cloudflare to
3.x(17612) until v4 releases which correctly usespluginsfor the pinned Payload version in that template.