---
title: Abort breaks resumable streams
description: Troubleshooting stream resumption failures when using abort functionality
url: "https://ai-sdk.dev/v5/docs/troubleshooting/abort-breaks-resumable-streams"
docs_index: /llms.txt
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

## Issue

When using `useChat` with `resume: true` for stream resumption, the abort functionality breaks. Closing a tab, refreshing the page, or calling the `stop()` function will trigger an abort signal that interferes with the resumption mechanism, preventing streams from being properly resumed.

```tsx
// This configuration will cause conflicts
const { messages, stop } = useChat({
  id: chatId,
  resume: true, // Stream resumption enabled
});

// Closing the tab will trigger abort and stop resumption
```

## Background

When a page is closed or refreshed, the browser automatically sends an abort signal, which breaks the resumption flow.

## Current limitations

We're aware of this incompatibility and are exploring solutions. **In the meantime, please choose either stream resumption or abort functionality based on your application's requirements**, but not both.

### Option 1: Use stream resumption without abort

If you need to support long-running generations that persist across page reloads:

```tsx
const { messages, sendMessage } = useChat({
  id: chatId,
  resume: true,
});
```

### Option 2: Use abort without stream resumption

If you need to allow users to stop streams manually:

```tsx
const { messages, sendMessage, stop } = useChat({
  id: chatId,
  resume: false, // Disable stream resumption (default behaviour)
});
```

## Related

- [Chatbot Resume Streams](/v5/docs/ai-sdk-ui/chatbot-resume-streams)
- [Stopping Streams](/v5/docs/advanced/stopping-streams)

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)