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: passing an invalid compatibility_date in wrangler.toml causes env variables not to be bound #7178

Open
adamdehaven opened this issue Nov 5, 2024 · 5 comments
Labels
bug Something that isn't working needs reproduction Needs reproduction from OP

Comments

@adamdehaven
Copy link

Which Cloudflare product(s) does this pertain to?

Workers Runtime, Wrangler

What version(s) of the tool(s) are you using?

3.82.0 [Wrangler]

What version of Node are you using?

20.18.0

What operating system and version are you using?

Mac Sonoma

Describe the Bug

Observed behavior

Passing an invalid compatibility_date in a wrangler.toml (e.g. 2024-11-05 as of today) does not throw an error; however, it causes any environment variables and secrets to not be available in the deployed worker.

Expected behavior

The invalid compatibility_date should fallback to the latest valid compatibility_date, and environment variables and secrets should be properly available in the worker.

Steps to reproduce

  1. Create a valid wrangler.toml with the following setting:
    compatibility_date = "2024-11-05"
  2. Add an environment secret in the Cloudflare Dashboard UI, and deploy the secret
  3. Deploy your worker via wrangler using the wrangler.toml and notice your environment variable is not available.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@adamdehaven adamdehaven added the bug Something that isn't working label Nov 5, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 5, 2024
@irvinebroque
Copy link
Contributor

Can't reproduce this with same exact steps, are you certain that is happening?

@adamdehaven
Copy link
Author

Can't reproduce this with same exact steps, are you certain that is happening?

I’m not sure why else I’d have opened the issue…

Is there a recommended way to submit a reproduction?

@WalshyDev
Copy link
Member

WalshyDev commented Nov 11, 2024

Add an environment secret in the Cloudflare Dashboard UI, and deploy the secret

Make sure this is a secret and not an environment variable. If you define an env var (not secret) within the dashboard and deploy with it not in your wrangler.toml it will be removed.

We recently updated the UI to make it clearer when you're adding a secret - can you please try this again? Make sure to select "Type" -> "Secret"
image

Sorry that this is confusing, hopefully the new UI helps :)

@adamdehaven
Copy link
Author

Make sure this is a secret and not an environment variable.

Yes, it’s a secret defined in our terraform config for the worker

@penalosa
Copy link
Contributor

Is there a recommended way to submit a reproduction?

Could you provide a link to a GitHub repo that demonstrates the issue?

@penalosa penalosa added the needs reproduction Needs reproduction from OP label Nov 11, 2024
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 needs reproduction Needs reproduction from OP
Projects
Status: Untriaged
Development

No branches or pull requests

4 participants