#Error while building the Cloudflare template

17 messages · Page 1 of 1 (latest)

glad aspen
#

I'm getting an error while building the Cloudflare template with the link that is provided by Payload:
https://github.com/payloadcms/payload/tree/main/templates/with-cloudflare-d1
Not sure if it's Payload or Cloudflare that need to solve this, but I'm mentioning it so the team can solve this for everybody.
Or if anybody in this chat has solution to this.
I don't see where I can control the bucket's name, not even sure if it's given by Payload in their setup or Cloudflare.

GitHub

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for buildi...

waxen sentinelBOT
brittle scaffold
glad aspen
#

Hey rjgtav,
Nop, I don't find where to modify the bucket's name.
I followed Payload's tutorial.
I wrote to Cloudflare support as well to know where I can modify this

brittle scaffold
#

Did you use the "Deploy to Cloudflare" button?

glad aspen
#

Yep, I tried 3 times
Deleting my repo and worker every time to start fresh

brittle scaffold
#

Okok. When you use the "Deploy to Cloudflare" button, there's a section of the "Setup your application" form that allows you to configure the R2 bucket, either use an existing one or create a new one.

When using the "Deploy to Cloudflare" flow, it will create a new repository in your Github account, which will then be used for storing your project.

If you open that repository, you'll find a file called wrangler.jsonc which will contain the configuration for the Cloudflare Worker.

Inside that file there's a section for "r2_buckets" and inside it you can see that there's a bucket with the name of "R2R2Bucket". This is the value you need to fix, by changing to one of the buckets you already have in your Cloudflare account. If needed, you can create a new bucket from the Cloudflare Dashboard

glad aspen
#

Thank you for taking the time to reply, it's really appreciated
I'll try this right now, but I tried again and recorded it so you can the error can be seen and solved by the right people.
I'm cleary selecting s bucket named 'lake-atitlan-community', so I don't understand where the name in the error log is coming from.
Here's the Loom video: https://www.loom.com/share/2c3878d75e1b4c22a62ac422092c9aa9?sid=4a448292-f2a2-4bc5-8602-4af065079da8

brittle scaffold
#

thanks for the video!
Interesting.. I wonder if it's a bug that just cropped up in the "Deploy to Cloudflare" flow.
Can you check how the wrangler.jsonc looks like in the new Github repo? In the r2_buckets section, in particular

glad aspen
#

Thanks again,
It's now building and deploying properly.
In the template their provide, it's set to 'my-app', so I really don't understand where this "R2R2Bucket" name is coming from.

brittle scaffold
#

Hmm.. did you change anything or did you simply retry the build?

glad aspen
#

I did what you said, I changed the name of the bucket in the 'wrangler.jsonc' that was set to "R2R2Bucket" for the name of my project, in the repo that was created and then rebuilt.

brittle scaffold
#

Okok. Glad you got it fixed. I'll try to reproduce it myself and figure out what's setting R2R2Bucket in the config

brittle scaffold
#

Managed to reproduce it! Seems to be a bug when using an existing bucket. I'll flag it internally. Thanks for reporting it!

floral gale
#

@brittle scaffold any ETA? was hoping to showcase the 1-click starter to my company, and get them to sign up for cloudflare so we can migrate from wordpress

brittle scaffold
brittle scaffold
#

@floral gale Hi! Can confirm that it has already been fixed! Just tried it myself and the bucket_name was properly configured in wrangler.jsonc this time around