Skip to content

Aborted streaming server function never settles on the client #8729

Open

Description

@harisonw

Which project does this relate to?

Start

Describe the bug

Aborting a streaming server function (an async generator handler) stops the stream, but the client's for await loop never ends or throws. It stays pending forever.

const stream = await streamNumbers({ signal: controller.signal })
for await (const n of stream) { ... }
// after controller.abort(): never reaches here, and never throws

The console logs Stream processing error: AbortError from processFramedResponse in serverFnFetcher. That catch block logs the error but doesn't pass it to the stream the caller is reading.

Complete minimal reproducer

https://github.com/harisonw/start-stream-abort-repro

Steps to Reproduce the Bug

  1. npm install && npm run dev
  2. Click Start. Numbers stream in.
  3. Click Stop.

Expected behavior

After Stop, the for await loop throws an AbortError (or ends), so the status changes. Instead it stays streaming forever.

Platform

  • Router / Start Version: @tanstack/react-start 1.169.2, @tanstack/start-client-core 1.170.37
  • OS: Linux
  • Browser: Chrome
  • Browser Version: 155
  • Bundler: vite
  • Bundler Version: 8.3.4

Additional context

Not the same as #4651, which was about the server not seeing the abort. This one is on the client.

Drafted with AI help, reviewed by me.

Activity

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