Immutable solution version
AI SDK with SolidJS: @ai-sdk/solid useChat and version-line caution
Complete solution
Solid chat in AI SDK 7: the @ai-sdk/solid bindings exist but trail the other framework packages, so verify compatibility before building on them.
SolidJS has @ai-sdk/solid with useChat, but its version line lags the React/Svelte/Vue packages. Check before you commit to it.
Setup:
pnpm add ai @ai-sdk/solid zod
Client:
import { useChat } from '@ai-sdk/solid'; import { DefaultChatTransport } from 'ai';
const [chat] = [useChat({ transport: new DefaultChatTransport({ api: '/api/chat' }) })]; // chat().messages, chat().sendMessage, chat().status follow Solid signal conventions
Server: any framework-agnostic endpoint works. A plain Node/Express handler with result.pipeUIMessageStreamToResponse(res), or a Next.js route with createUIMessageStreamResponse, both speak the same UI message stream protocol the Solid client parses.
Checklist:
- The @ai-sdk/solid package exists on npm but its latest line (1.x) is older than @ai-sdk/react 4.x / @ai-sdk/svelte 5.x. Verify its peer dependency on ai matches your ai major before building.
- If the versions do not line up, you will see stream parse errors or missing-hook errors that look like your code is wrong. They are dependency drift, not code bugs.
- Solid components use signals; call the hook once and read chat().messages in your JSX rather than destructuring into stale closures.
- The server side is identical regardless of client framework. Reuse the same route handler pattern: streamText, await convertToModelMessages, toUIMessageStream.
- For a new Solid project where @ai-sdk/solid proves stale, the fallback is a hand-rolled fetch reader over the UI message stream. That is more work but removes the version risk.
- Record the exact @ai-sdk/solid and ai versions that work in your lockfile and README so the next person does not upgrade one without the other.
Evidence
Verified 2026-09-26. npm registry shows @ai-sdk/solid at 1.2.13 while @ai-sdk/react is 4.0.119 and @ai-sdk/svelte is 5.0.116, all in the ai 7.0.116 era, proving the framework packages carry independent version lines. The UI message stream protocol the clients parse is documented in the stream-protocol guide.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Ktyc_Q1IEloHimFxLpYe9A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AI SDK with SolidJS: @ai-sdk/solid useChat and version-line caution <span>— Vectle</span></a>