HardAtWork
03/28/2023, 7:14 PMGeorgeTailor
03/28/2023, 7:21 PMFormData
when I call BUCKET.put(key, file)
From what I found it is quite common issue, the worker awaits the response from R2 until timeout.
Typescript types suggest that you can put
Blob perfectly fine, but in reality you cannot
https://community.cloudflare.com/t/r2-put-object-throws-network-connection-lost-error/430109
this error was reported multiple times in various places, even on SO. Maybe just remove Blob
from accepted types and mention in the docs that R2 expects a stream rather than a file?Dani Foldi
03/28/2023, 7:25 PMGeorgeTailor
03/28/2023, 7:25 PM<img src="https://r2.example.com/image-uuid"/>
How do I do that locally?Karthik
03/28/2023, 7:28 PMGeorgeTailor
03/28/2023, 7:28 PM"moduleResolution": "node"
you cannot change "types": ["@cloudflare/workers-types/experimental"],
it always points to the oldest compat date (the one in the root)
without moduleResolution I have problems with importing anything that is not ts or js.
but I also checked in experimental folder and it also has this:
put(
key: string,
value:
| ReadableStream
| ArrayBuffer
| ArrayBufferView
| string
| null
| Blob,
options?: R2PutOptions
): Promise<R2Object>;
kian
03/28/2023, 7:29 PMfile.stream()
GeorgeTailor
03/28/2023, 7:29 PMGeorgeTailor
03/28/2023, 8:27 PMstate
folder from .wrangler
folder in the root of my project to whatever place inside my local serve folder. Also some additional logic required in frontend JS to determine which origin to use, localhost
or my r2.example.com
so when I run wrangler pages dev public
the --persist-to
should be set to public/state
.
However, due to broken CI on Cloudflare I need to deploy manually, is there an option somewhere I can pass to wrangler so that it ignores a specific folder when publishing with wrangler pages publish public
?GeorgeTailor
03/28/2023, 8:41 PM[site]
bucket = "./public"
exclude = ["local_state"]
from here https://developers.cloudflare.com/workers/wrangler/configuration/#workers-sites doesn't worklevifig
03/28/2023, 10:50 PMshirt
03/28/2023, 11:37 PMshirt
03/28/2023, 11:38 PMWalshy | Pages
03/28/2023, 11:40 PMJeff12345
03/28/2023, 11:43 PMkian
03/28/2023, 11:44 PMkian
03/28/2023, 11:44 PMkian
03/28/2023, 11:45 PMJeff12345
03/28/2023, 11:45 PMJeff12345
03/28/2023, 11:45 PMkevfly
03/29/2023, 12:10 AMkevfly
03/29/2023, 12:52 AMshirt
03/29/2023, 1:09 AMWalshy | Pages
03/29/2023, 1:09 AMshirt
03/29/2023, 1:09 AMWalshy | Pages
03/29/2023, 1:53 AMshirt
03/29/2023, 8:21 AMkoreyoshi_re
03/29/2023, 8:46 AMoc
03/29/2023, 2:26 PMoc
03/29/2023, 2:27 PM