Skip to content

Update binding output for KV when creating new namespace #9549

Open
@harshil1712

Description

@harshil1712

What versions & operating system are you using?

Wrangler 4.19.1, node 22.14.0

Please provide a link to a minimal reproduction

No response

Describe the Bug

When creating a new KV namespace with the --preview flag, the output doesn't show id in the bindings.
If a user copies the returned output in the Wrangler file, and run the project, they will get an error:

- "kv_namespaces[0]" bindings should have a string "id" field but got
  {"binding":"TODOS","preview_id":"<ID>"}.

We should also return an ID so that the user has correct bindings in their Wrangler file.

Please provide any relevant error logs

  • "kv_namespaces[0]" bindings should have a string "id" field but got
    {"binding":"TODOS","preview_id":""}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that isn't workingquick winPotentially easy/straightforward issue to tackle

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions