core icon indicating copy to clipboard operation
core copied to clipboard

Browser rendering: Cloudflare API error - binding $DurableObject of type durable_object_namespace cannot specify both a class_name and a namespace_id

Open fayazara opened this issue 7 months ago • 2 comments

Describe the bug

When deploying a NuxtHub project with the browser feature enabled, the deployment fails with a Cloudflare API error about Durable Object configuration. The error message states: "binding $DurableObject of type durable_object_namespace cannot specify both a class_name and a namespace_id". The browser feature works correctly in development mode but fails during production deployment.

Steps to reproduce

  1. Create a NuxtHub project with the browser feature enabled in nuxt.config.ts
  2. Install required dependencies (@cloudflare/puppeteer and puppeteer)
  3. Create an API endpoint that uses hubBrowser() (e.g., for screenshot functionality)
  4. Run the project locally with pnpm run dev (works fine)
  5. Try to deploy to production using npx nuxthub deploy
  6. Deployment fails with the Durable Object binding error

Expected behavior

The project should deploy successfully to production with the browser feature working as it does in development.

Additional information

  1. The error occurs with both CLI deployment (npx nuxthub deploy) and GitHub Actions deployment
  2. When checking Cloudflare settings, no browser_rendering binding is being created
  3. NuxtHub version: 0.8.27
  4. Dependencies are properly installed in package.json
  5. Workers is enabled in hub config

Full error message

✖ Failed to deploy fred-workers-test to production.

 ERROR  Cloudflare API error - binding $DurableObject of type durable_object_namespace cannot specify both a class_name and a namespace_id 

fayazara avatar May 17 '25 06:05 fayazara

CC: @frederic-nevers

fayazara avatar May 17 '25 06:05 fayazara

I have experienced the same issue, but not just with 'browser'. It also happens when adding 'cache', for example

frederic-nevers avatar May 19 '25 11:05 frederic-nevers