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

🚀 Feature Request: wrangler types should use union types for possible values #6931

Closed
luisrudge opened this issue Oct 9, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@luisrudge
Copy link

luisrudge commented Oct 9, 2024

Describe the solution

wrangler.toml

[vars]
SEND_EMAILS_ENABLED = "false"

[env.preview.vars]
SEND_EMAILS_ENABLED = "true"

[env.production.vars]
SEND_EMAILS_ENABLED = "true"

when I run wrangler types, it creates this interface:

interface Env {
	SEND_EMAILS_ENABLED: "false";
}

which causes a type error because the type is not 'false' | 'true' or even string.
image

So the values need to be generated with all the possible values, and not with only the local value.

@luisrudge luisrudge added the enhancement New feature or request label Oct 9, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Oct 9, 2024
@emily-shen
Copy link
Contributor

cc @andyjessop

@emily-shen emily-shen removed this from workers-sdk Oct 9, 2024
@penalosa
Copy link
Contributor

penalosa commented Nov 8, 2024

Closing as duplicate of #5082

@penalosa penalosa closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants