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

Open
luisrudge opened this issue Oct 9, 2024 · 1 comment
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
@emily-shen
Copy link
Contributor

cc @andyjessop

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

2 participants