Closed gnosticdev closed 8 months ago
The @cloudflare/workers-types
package has several folders which contain the correct types for different compatibility dates. If you don't specify one of those, you will default to the oldest types.
You need to be on (at least) the 2022-08-04 types for the include
property, since it wasn't respected up until that compatibility date when it was fixed via the r2_list_honor_include
flag.
Replace @cloudflare/workers-types
in tsconfig.json
with the appropriate set, i.e @cloudflare/workers-types/2023-07-01
if your compatibility date is on or after 2023-07-01
.
Ah I shouldve known that would have an impact. Thanks!
Jesse Greer
On Jan 8, 2024, at 8:37 PM, Kian @.***> wrote:
The @cloudflare/workers-types package has several folders which contain the correct types for different compatibility dates. If you don't specify one of those, you will default to the oldest types.
You need to be on (at least) the 2022-08-04 types for the include property, since it wasn't respected up until that compatibility date when it was fixed via the r2_list_honor_include https://developers.cloudflare.com/workers/configuration/compatibility-dates/#r2-bucket-list-respects-the-include-option flag.
Replace @cloudflare/workers-types in tsconfig.json with the appropriate set, i.e @cloudflare/workers-types/2023-07-01 if your compatibility date is on or after 2023-07-01.
— Reply to this email directly, view it on GitHub https://github.com/cloudflare/workerd/issues/1522#issuecomment-1882132968, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM3ZKPZKRHSOCUMP4AXP7TYNSNPPAVCNFSM6AAAAABBSFYW5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBSGEZTEOJWHA. You are receiving this because you authored the thread.
Looks like this has been resolved. We're working on a new types generation system that should make these kind of issues harder to come by. 👍
Per the API Reference:
R2ListOptions
has aninclude
property that acceptshttpMetadata
and/orcustomMetadata
. If included, items returned by the list will include the specified metadata.This property is not included in the typescript definitions: