Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: Version Metadata Type Generated does not include timestamp #7908

Open
Jbithell opened this issue Jan 26, 2025 · 1 comment
Open
Labels
bug Something that isn't working

Comments

@Jbithell
Copy link

Which Cloudflare product(s) does this pertain to?

Wrangler

What versions are you using?

3.105.1

What operating system and version are you using?

MacOS

Please provide a link to a minimal reproduction

No response

Describe the Bug

When a binding is set to version_metadata, and wrangler types is run, the type generated is missing the timestamp field in worker-configuration.d.ts.

Wrangler configuration:

"version_metadata": {
  "binding": "CF_VERSION_METADATA"
}

Type generated:

interface Env {
  CF_VERSION_METADATA: { id: string; tag: string };
}

Relevant code:

"{ id: string; tag: string }",

Confusingly the docs also expose this bug - showing different vars returned for JS & TS

const { id: versionId, tag: versionTag, timestamp: versionTimestamp } = env.CF_VERSION_METADATA;
const { id: versionId, tag: versionTag } = env.CF_VERSION_METADATA;

Workaround

Edit worker-configuration.d.ts to manually add timestamp: string to the CF_VERSION_METADATA field

interface Env {
  CF_VERSION_METADATA: { id: string; tag: string; timestamp: string };
}

This must be repeated each time wrangler types is run

Please provide any relevant error logs

No response

@Jbithell Jbithell added the bug Something that isn't working label Jan 26, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jan 26, 2025
@andyjessop andyjessop moved this from Untriaged to Backlog in workers-sdk Jan 27, 2025
@Asask-sized
Copy link

#7954 bugs running

continuously

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants