Skip to content

useChat stop() abortSignal doesn't stop generation when running in edge runtime (vercel dev) #6422

Open
@ShadowWalker2014

Description

@ShadowWalker2014

Description

We are using useChat() from ai/react on the frontend and streamText() with abortSignal controller on the backend.

When running vercel dev, attempt to stop a streaming text generation isn't stopping the generation at all. However, if we use npm run dev and stop the stream, it works normally.

It would seem to be quite ironic that vercel's own sdk doesn't support stop signal when hosted in vercel's edge env (or while using vercel dev to develop).

Is there any fix to this problem? Thanks in advance!

const { stop } = useChat();

AI SDK Version

  • ai: 4.3.16
  • ai-sdk/react: 1.2.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions