@ai-sdk/svelte 2.0.0 removes useChat, useCompletion and useAssistant along with their helper types, and it requires svelte 5, where 1.1.24 accepted 3, 4 or 5. Any file that imports one of these names from @ai-sdk/svelte stops type-checking. Svelte 5 is a prerequisite for the replacements, so check your installed svelte first.

What changed

Before and after

The site you are most likely to meet is a component that destructures stores from useChat:

<script lang="ts">
import { useChat } from '@ai-sdk/svelte';
const { messages, input, handleSubmit } = useChat({ api: '/api/chat', keepLastMessageOnError: true });
</script>
{#each $messages as message (message.id)}
<p>{message.content}</p>
{/each}
<form on:submit={handleSubmit}><input bind:value={$input} /></form>

The assisted patch constructs the chat once, drops keepLastMessageOnError, and reads properties off the instance without destructuring them:

<script lang="ts">
import { Chat } from '@ai-sdk/svelte';
const chat = new Chat({ api: '/api/chat' });
</script>
{#each chat.messages as message (message.id)}
<p>{message.content}</p>
{/each}
<form onsubmit={chat.handleSubmit}><input bind:value={chat.input} /></form>

The patch edits the script only. Change the markup reads alongside it, as shown above. The useCompletion rewrite follows the same shape, with isLoading renamed to loading. No change in this release has a deterministic patch.

Migration guidance and its limits

Run emendant scan to list the files that import the removed names, then emendant fix. All three findings have assisted patches, so emendant fix writes one only when you name a model provider, on the command line or in your Emendant configuration. Each patch is checked with your typecheck and with the tests it affects. Nothing in this release is report only.

If your installed svelte is older than 5, the classes cannot be used and the patch does not apply. Upgrade svelte first, then run the fix again.

useAssistant is the exception to the other two. Moving off it means moving the route off the Assistants API onto one that Chat can read, which changes the server as well as the component. The patch does not attempt that rewrite, so replace the store by hand.

A clean scan covers imports of the removed names from @ai-sdk/svelte in .ts files and in the script of a .svelte file. Names imported from other packages, such as @ai-sdk/react, are not reported, and neither are store reads in markup. Review those reads yourself, and check any code that destructured values from the old result, because a destructured value from a class instance does not update.

What Emendant detects, fixes and verifies

3 changes in @ai-sdk/svelte 2.0.0. 0 automatic fixes, 3 fixes requiring a model provider you choose, 0 report only. Each patch states which checks passed. Understand patch evidence.

ChangeSeverityDetectsFixVerified by
useChat was removed in favour of the Chat class
ai-sdk-svelte-npm-2.0.0-use-chat-removed
error TS2305: Module '"@ai-sdk/svelte"' has no exported member 'useChat'.
error TS2305: Module '"@ai-sdk/svelte"' has no exported member 'UseChatHelpers'.
error TS2724: '"@ai-sdk/svelte"' has no exported member named 'UseChatOptions'. Did you mean 'ChatOptions'?
Breaking
  • useChat imported from @ai-sdk/svelte
  • UseChatHelpers imported from @ai-sdk/svelte
  • UseChatOptions imported from @ai-sdk/svelte
Patch, only when you name a model providerYour typecheck and tests
useCompletion was removed in favour of the Completion class
ai-sdk-svelte-npm-2.0.0-use-completion-removed
error TS2724: '"@ai-sdk/svelte"' has no exported member named 'useCompletion'. Did you mean 'Completion'?
error TS2305: Module '"@ai-sdk/svelte"' has no exported member 'UseCompletionHelpers'.
error TS2724: '"@ai-sdk/svelte"' has no exported member named 'UseCompletionOptions'. Did you mean 'CompletionOptions'?
Breaking
  • useCompletion imported from @ai-sdk/svelte
  • UseCompletionHelpers imported from @ai-sdk/svelte
  • UseCompletionOptions imported from @ai-sdk/svelte
Patch, only when you name a model providerYour typecheck and tests
useAssistant was removed
ai-sdk-svelte-npm-2.0.0-use-assistant-removed
error TS2305: Module '"@ai-sdk/svelte"' has no exported member 'useAssistant'.
error TS2305: Module '"@ai-sdk/svelte"' has no exported member 'UseAssistantHelpers'.
Breaking
  • useAssistant imported from @ai-sdk/svelte
  • UseAssistantHelpers imported from @ai-sdk/svelte
Patch, only when you name a model providerYour typecheck and tests

emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.

The error TS lines are what TypeScript 5.9.3 printed when code that compiled against @ai-sdk/svelte 1.1.24 was compiled against 2.0.0. A row without one is a change the compiler does not report, such as a deprecation or a change in behaviour.

Coverage

Requires emendant@0.3.0 or later. Run emendant feed update to get the latest coverage.

Coverage details
Snapshot
2026-10-22.2, sequence 56, signed 22 October 2026
Feed entry
feed/npm/@ai-sdk/svelte/2.0.0.json

emendant feed status shows the snapshot your machine holds.

Primary sources

Scan your repository

Find affected code without editing your files.

npx emendant scan

Then npx emendant fix writes the patches the table says exist. The getting started guide covers the flags and the patch grades.

Every @ai-sdk/svelte release page is listed on one page.