Registry Mirror
Skip to content

Does not run with bun (dev only) #1098

Closed

Description

@medz

Environment


  • Operating System: Darwin
  • Node Version: v22.19.0
  • Nuxt Version: 4.1.3
  • CLI Version: 3.29.3
  • Nitro Version: 2.12.7
  • Package Manager: bun@1.3.0
  • Builder: -
  • User Config: compatibilityDate, devtools, nitro
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/medz/github-fmzbfj/tree/main/bun-1.3-nuxt-post-500

Describe the bug

When using bun --bun run nuxt dev or nitro: { preset: "bun" }, all requests except GET return 400 errors.

Additional context

This problem only occurs during dev. There will be no problem running it using bun after build.

Logs

There are no errors in your output

Activity

  1. added theissue type on Oct 19, 2025
  2. github-actions commented on Oct 19, 2025

    @github-actions
    Contributor

    Stackblitz link for the reproduction: Stackblitz

  3. medz commented on Oct 19, 2025

    @medz
    Author
    Image Image Image
  4. Flo0806 commented on Oct 20, 2025

    @Flo0806
    Member

    Hi. I think that's a bun bug. If I start with --bun I can't see any response with CURL.
    Since the request doesn't even reach Nitro (no handler logs, no response body, just a 400 with Content-Length: 0 from Bun's HTTP server), I believe this is definitely a Bun bug rather than a Nuxt/Nitro issue.

    Evidence:

    • bun --bun run dev → POST returns 400 ❌
    • bun run dev (uses Node.js) → POST works perfectly ✅
    • The handler is never executed (no console logs)
    • Bun's server returns the 400 before the request reaches Nitro

    Workaround:
    Use bun run dev without the --bun flag until this is fixed in Bun.

    Am I missing something, or should this be reported to the Bun repository instead?

  5. medz commented on Oct 20, 2025

    @medz
    Author

    Hi. I think that's a bun bug. If I start with --bun I can't see any response with CURL. Since the request doesn't even reach Nitro (no handler logs, no response body, just a 400 with Content-Length: 0 from Bun's HTTP server), I believe this is definitely a Bun bug rather than a Nuxt/Nitro issue.

    Evidence:

    • bun --bun run dev → POST returns 400 ❌
    • bun run dev (uses Node.js) → POST works perfectly ✅
    • The handler is never executed (no console logs)
    • Bun's server returns the 400 before the request reaches Nitro

    Workaround: Use bun run dev without the --bun flag until this is fixed in Bun.

    Am I missing something, or should this be reported to the Bun repository instead?

    Temporary solution is not feasible because I use Bun Runtime APIs extensively in the Server part.

  6. huang-julien commented on Oct 20, 2025

    @huang-julien
    Member

    I think this is related to the CLI moving to socket a few versions ago

    Image
  7. added theissue type on Oct 26, 2025
  8. transferred this issue fromnuxt/nuxton Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions