Skip to content

convex dev --start leaves next dev --turbopack running after Ctrl+C #441

@brandon-julio-t

Description

@brandon-julio-t

Summary

When running convex dev with --start through Bun's script runner, pressing Ctrl+C stops the Convex dev process but does not always stop the command started via --start.

In my case, the package script is:

{
  "scripts": {
    "dev": "convex dev --start 'next dev --turbopack'"
  }
}

Running bun run dev can leave the Next.js dev server running in the background after Ctrl+C, which leaves orphaned processes around and can cause memory leaks or stale dev servers on the same port.

Steps To Reproduce

  1. Add a package script like:

    {
      "scripts": {
        "dev": "convex dev --start 'next dev --turbopack'"
      }
    }
  2. Run:

    bun run dev
  3. Wait for both Convex and Next.js to start.

  4. Press Ctrl+C.

Expected Behavior

Both processes should shut down cleanly:

  • convex dev should exit
  • the --start command and its child processes should also exit

Actual Behavior

  • convex dev exits
  • next dev --turbopack can continue running in the background
Screen.Recording.2026-04-12.at.18.22.23.mp4

Impact

  • orphaned dev server processes
  • memory usage continues growing after Convex exits
  • port conflicts on the next run
  • confusing local dev behavior because Convex is stopped but Next is still alive

Environment

  • OS: macOS
  • Invocation: bun run dev
  • Script: convex dev --start 'next dev --turbopack'
  • Framework: Next.js dev server with Turbopack

Notes

  • After further testing, I can only reproduce this when Convex is invoked via Bun's script runner.

  • Running Convex directly, for example:

    bunx convex dev --start 'next dev --turbopack'

    shuts down correctly on Ctrl+C in my setup.

  • So this appears to be specifically about the bun run invocation path rather than convex dev --start being broken in all invocation modes.

  • Here are some verbose logs from the failing bun run path: https://gist.github.com/brandon-julio-t/4b276c6bd8e3fb04ce502a51297ab3b5

Maybe relevant issues:

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