Skip to content

🐛 BUG: wrangler types copies actual string from wrangler.toml instead of the type #7273

@shmuli9

Description

@shmuli9

Which Cloudflare product(s) does this pertain to?

Wrangler

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

3.86.1 & 3.87.0 [Wrangler]

What version of Node are you using?

20.15.0

What operating system and version are you using?

Windows 11

Describe the Bug

Observed behavior

When running wrangler types the worker-configuration.d.ts is wrongly populated with the actual value in the wrangler.toml instead of setting up the types

Expected behavior

When running wrangler types the worker-configuration.d.ts is sets up the types to reflect the types of values in the wrangler.toml

Steps to reproduce

Please provide the following:

wrangler.toml

[vars]
SERVER_ADDRESS = "http://localhost:3000/event"
BUCKET_NAME ="my-bucket"
CLOUDFLARE_ACCOUNT_ID="XXXXX"
ACCESS_KEY_ID="XXXXX"

worker-configuration.d.ts

// Generated by Wrangler by running `wrangler types`

interface Env {
	SERVER_ADDRESS: "http://localhost:3000/event";
	BUCKET_NAME: "my-bucket";
	CLOUDFLARE_ACCOUNT_ID: "XXXXX";
	ACCESS_KEY_ID: "XXXXX";
	SECRET_ACCESS_KEY: string;
	BUCKET: R2Bucket;
	DB: D1Database;
	QUEUE: Queue;
}
  • Commands used to start your local dev server, including custom env and cli args
    npx wrangler types

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions