Skip to content

ERROR Failed to initialize wrangler bindings proxy spawn EBADF #55

Open

Description

@justin-schroeder

I really, truly, wish I could reproduce this for you, but I figured it would at least help to drop this issue here as a marker. This issue seems to pop up entirely randomly.

Here is the stack trace:

ERROR  Failed to initialize wrangler bindings proxy spawn EBADF

    at ChildProcess.spawn (node:internal/child_process:421:11)
    at Object.spawn (node:child_process:761:9)
    at Runtime.updateConfig (node_modules/.pnpm/miniflare@3.20250310.0/node_modules/miniflare/dist/src/index.js:10115:57)
    at async #assembleAndUpdateConfig (node_modules/.pnpm/miniflare@3.20250310.0/node_modules/miniflare/dist/src/index.js:15339:30)
    at async Mutex.runWith (node_modules/.pnpm/miniflare@3.20250310.0/node_modules/miniflare/dist/src/index.js:1725:16)
    at async #waitForReady (node_modules/.pnpm/miniflare@3.20250310.0/node_modules/miniflare/dist/src/index.js:15403:5)
    at async Miniflare2._getProxyClient (node_modules/.pnpm/miniflare@3.20250310.0/node_modules/miniflare/dist/src/index.js:15527:5)
    at async Miniflare2.getBindings (node_modules/.pnpm/miniflare@3.20250310.0/node_modules/miniflare/dist/src/index.js:15546:25)
    at async getPlatformProxy (node_modules/.pnpm/wrangler@3.114.1_@cloudflare+workers-types@4.20250311.0/node_modules/wrangler/wrangler-dist/cli.js:158007:20)
    at async _getPlatformProxy (.nuxt/dev/index.mjs:5326:17)

This may be a miniflare issue too, although it doesnt look like that repo gets a lot of love. The specific spawn that is being attempted is workerd with the following arguments:

[
  'serve',
  '--binary',
  '--experimental',
  '--socket-addr=entry=127.0.0.1:0',
  '--external-addr=loopback=127.0.0.1:64989',
  '--control-fd=3',
  '-'
]

I cannot reliably get this to go away once it starts. I pnpm install, delete node modules, nuxi cleanup — none of that works, but then all of a sudden it does start working. I have no idea to be honest.

Environment

  • Operating System: Darwin
  • Node Version: v20.11.0
  • Nuxt Version: 3.16.0
  • CLI Version: 3.22.5
  • Nitro Version: 2.11.6
  • Package Manager: pnpm@8.15.4
  • Builder: -
  • User Config: app, compatibilityDate, modules, runtimeConfig, turnstile, css, postcss, imports, devtools, nitro
  • Runtime Modules: nitro-cloudflare-dev@0.2.2, @nuxt/icon@1.10.3, @nuxtjs/turnstile@0.9.15, @pinia/nuxt@0.9.0
  • Build Modules: -

Activity

  1. justin-schroeder commented on Apr 25, 2025

    @justin-schroeder
    Author

    Update: for folks struggling with this, it happens when sub-directories in the .wrangler directory fill up with a lot of files - this can be especially true for kv values since each creates its own file on the filesystem. MacOS has a limit on how many open handles it can take at a time and eventually it runs out and you'll get this error. The only solution, afaik, is to purge those kv files occasionally.

  2. miantiao-me commented on Aug 10, 2025

    @miantiao-me

    I encountered this issue as well. I restored functionality after using pnpx nuxi cleanup.

  3. adamdehaven commented on Jul 18, 2026

    @adamdehaven
    Member

    @pi0 any chance you have ideas here? This is constantly an issue 😢

  4. arashsheyda commented on Jul 22, 2026

    @arashsheyda

    @justin-schroeder solution used to work for me but it stopped today... I found out adding this to nuxt.conig.ts works:

     typescript: {
        // Run type checking separately or during builds to avoid exhausting macOS spawn-compatible file descriptors in development.
        typeCheck: 'build' // used to be `true`,
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions