Skip to content

[BUG] Bindings types aren't being populated despite running npx wrangler types #597

@thomasgauvin

Description

@thomasgauvin

Describe the bug

When using bindings using getCloudflareContext, then bindings don't seem to be populated on the CloudflareEnv return type, despite running npx wrangler types.

Image

Steps to reproduce

  1. Create a OpenNext.js project
  2. Add bindings in Wrangler.jsonc
  3. npx wrangler types
  4. In a server action try to access the binding. Notice binding type error.

Expected behavior

The binding type is properly configured so that intellisense does not complain and we get type safety.

@opennextjs/cloudflare version

1.0.0-beta.3

Wrangler version

4.12.0

next info output

Using vars defined in .dev.vars
/bin/sh: yarn: command not found
/bin/sh: pnpm: command not found

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 20.11.0
  npm: 10.2.4
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.3.1 // Latest available version is detected (15.3.1).
  eslint-config-next: 15.3.1
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions