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: Wrangler type generation doesn't take into account type of variable for different environments #5850

Closed
stevezhu opened this issue May 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@stevezhu
Copy link

stevezhu commented May 15, 2024

Which Cloudflare product(s) does this pertain to?

Wrangler core

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

3.56.0 [Wrangler]

What version of Node are you using?

21.0.0

What operating system and version are you using?

Windows 11

Describe the Bug

Observed behavior

Wrangler type generation doesn't take into account type of variable for different environments.

With the following wrangler.toml config:

#:schema node_modules/wrangler/config-schema.json
name = "example"
compatibility_date = "2024-05-12"

vars = { ENVIRONMENT = "dev" }

[env.staging]
vars = { ENVIRONMENT = "staging" }

[env.production]
vars = { ENVIRONMENT = "production" }

The output of wrangler types is:

// Generated by Wrangler on Wed May 15 2024 22:07:18 GMT+0000 (Coordinated Universal Time)
// by running `wrangler types`

interface Env {
	ENVIRONMENT: "dev";
}

Expected behavior

Should be expected to take into account the other environment vars and output one of the following:

interface Env {
	ENVIRONMENT: "dev" | "staging" | "production";
}

or

interface Env {
	ENVIRONMENT: string;
}

Steps to reproduce

CodeSandbox Example

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@stevezhu stevezhu added the bug Something that isn't working label May 15, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk May 15, 2024
@penalosa penalosa added enhancement New feature or request and removed bug Something that isn't working labels May 23, 2024
@stevezhu
Copy link
Author

Closing since this is a duplicate of #5082

@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Jul 21, 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
Archived in project
Development

No branches or pull requests

2 participants