Sato
CDCloudflare Developers
•Created by Sato on 10/15/2024 in #general-help
Is there a way to re-build faster with `wrangler pages dev`?
I'm making a website and testing it with
wrangler pages dev frontend/build --port 8787 --local
. But everytime I update my HTML, I have to run npm run build
which takes a while to finish. Is there a way to just make it update small HTML changes without having to rebuild each and every time?2 replies
CDCloudflare Developers
•Created by Sato on 10/13/2024 in #general-help
How do I keep spaces in filenames when using wrangler r2?
My filenames have spaces like "my docs.pdf" and when I run wrangler r2 object put project/my\ docs.pdf --file="/Users/user/Downloads/my docs.pdf" --local but then they show up as my%20docs.pdf and they don't match the file name in the DB. How can I put the actual file name without URL encoding?
4 replies
CDCloudflare Developers
•Created by Sato on 10/11/2024 in #pages-help
How to deploy pages from command line?
My project contains a frontend directory (with src/ and build/ inside it) and a functions directory (containing cloudflare functions). I usually deploy my cloudflare pages by just making a commit and pushing an update to the branch.
But I wanted to deploy without pushing and used this:
wrangler pages deploy frontend --project-name project
But now my deployed site is broken and blank. Maybe cause I only passed the frontend directory to the pages deploy
command and it missed the funcions/ directory? How do I do this properly?2 replies
CDCloudflare Developers
•Created by Sato on 10/9/2024 in #general-help
Wrangler r2 object put, get, and delete not doing anything locally
I have upload a file using
wrangler r2 object put project/test.pdf --file=/Users/me/Downloads/test.pdf --local
and it tells me Creating object "test.pdf" in bucket "project". Upload complete.
But then when I run wrangler r2 object get project/test.pdf
, it tells me ✘ [ERROR] The specified key does not exist.
However when I run the code const listed = await context.env.MY_BUCKET.list(); console.log('Files in bucket:', listed.objects.map(obj => obj.key));
with my wrangler.toml containing [[r2_buckets]] binding = "MY_BUCKET" bucket_name = "project"
it does contain test.pdf in the list of files. So how can I fix this?
Note that wrangler r2 object delete project/test.pdf
gives me a success code but then the file is still in the list I generate above.12 replies