Skip to content

[BUG] Unable to access Service Bindings during build #718

Open
@thipperz

Description

@thipperz

Describe the bug

I'm migrating my app from Next-on-Pages to OpenNext and started encountering errors and warnings in the build logs (Cloudflare dashboard) typically associated with local development (wrangler dev). These are now appearing even when deploying to preview or production environments.

Cannot access [service binding method] as we couldn't find a `wrangler dev` session for service "[service name]" to proxy to.

In my case, I followed the instructions here https://developers.cloudflare.com/workers/configuration/smart-placement/#best-practices and moved my backend functions (D1, Vectorize, Browser Rendering...) to Service Workers in order to optimize Smart Placement effects.

Is this expected behavior? Is support for remote service binding methods expected to come soon(ish)?

Thanks in advance.

Steps to reproduce

Try to access service binding methods during build time.

Expected behavior

No errors and app building the same way as with next-on-pages

@opennextjs/cloudflare version

1.2.0

Wrangler version

4.15.2

next info output

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Mon Apr 21 17:08:54 UTC 2025
  Available memory (MB): 7898
  Available CPU cores: 4
Binaries:
  Node: 22.16.0
  npm: 10.9.2
  Yarn: 1.22.21
  pnpm: 10.11.1
Relevant Packages:
  next: 15.4.0-canary.69 // Latest available version is detected (15.4.0-canary.69).
  eslint-config-next: 14.0.4
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.8.3
Next.js Config:
  output: N/A

Additional context

Error was ocurring with latest stable Next 15 version as well.

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