Skip to content

chore(templates): fix with-cloudflare-d1 storage adapter registration - #17217

Closed
soumajitgh wants to merge 1 commit into
payloadcms:mainfrom
soumajitgh:fix/cloudflare-d1-template
Closed

soumajitgh wants to merge 1 commit into
payloadcms:mainfrom
soumajitgh:fix/cloudflare-d1-template

Conversation

@soumajitgh

Copy link
Copy Markdown

Summary

This PR fixes the with-cloudflare-d1 template so its R2 storage adapter is registered correctly when the template is installed with the currently pinned released Payload packages.

Problem

The with-cloudflare-d1 template was updated to use the newer top-level storage config key, but the template still pins released 3.82.1 Payload packages.

On that release line, storage adapters are still expected to be registered through plugins, not storage. As a result, the r2Storage(...) adapter in the template is not initialized.

That mismatch causes two user-facing failures:

  • The admin UI crashes with Functions cannot be passed directly to Client Components because the unprocessed storage config leaks into the client config.
  • The R2 storage adapter is not actually wired up, so generated import-map output and upload behavior are incorrect for the template.

Solution

This change switches the with-cloudflare-d1 template back from storage: [...] to plugins: [...] for the r2Storage(...) registration.

That keeps the template aligned with the released 3.82.1 runtime behavior it currently installs, while preserving the intended R2 integration.

Impact

Users who create projects from templates/with-cloudflare-d1 with the currently published package versions should be able to:

  • start the app without the admin crash
  • generate the import map correctly
  • use the configured R2 storage adapter as intended

Validation

  • Reproduced the issue from the current template state before the fix by confirming the template used storage: [...] while pinning 3.82.1 packages.
  • Verified the fix in the template source by updating the adapter registration to plugins: [...] and committing only that scoped template change.

Related Issue

Fixes #17195

@nathanlentz

Copy link
Copy Markdown
Collaborator

@soumajitgh Thanks for opening this issue. The Cloudflare One Click template on main is now pointing to 3.x to avoid this issue until v4 releases. Link change was in this PR

@nathanlentz nathanlentz closed this Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants