Skip to content

Hyperdrive and WorkerVersionMetadata produce invalid declaration files. #6690

@Ernxst

Description

@Ernxst

Ignoring the type error, Using the following binding on a resource correctly binds it on Cloudflare, but breaks type generation:

sst.cloudflare.binding({
    type: "cloudflare.binding",
    binding: "versionMetadata",
    properties: {
      type: "version_metadata", // Hack! The sdk spreads properties onto the final binding so this gets used instead of the one above which doesn't map to anything in SST.
      name: this.#resourceName,
    },
  })

Produces (included supported resources for comparison):

// cloudflare 
import * as cloudflare from "@cloudflare/workers-types";
declare module "sst" {
  export interface Resource {
    "Api": cloudflare.Service
    "Auth": cloudflare.Service
    "Hyperdrive": cloudflare.
    "MailJobDLQ": cloudflare.Queue
    "MailJobQueue": cloudflare.Queue
    "VersionMetadata": cloudflare.
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions