-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Description
AI Elements uses the types from ToolUIPart["state"] from the AI SDK and checks against types added in AI SDK v6. Using the recommended install path described on the AI SDK docs leads to build errors due to strict type checking
Steps to reproduce:
- Set up Next App Router with AI SDK
pnpm create next-app@latest my-ai-app
cd my-ai-app
pnpm add ai @ai-sdk/react zod- (Sanity Check) Check if project builds
pnpm run build- Add AI Elements
npx ai-elements@latest- Check if project builds
pnpm run build
> [email protected] build /[...]/my-ai-app
> next build
▲ Next.js 16.0.3 (Turbopack)
Creating an optimized production build ...
✓ Compiled successfully in 662.5ms
Running TypeScript .Failed to compile.
./components/ai-elements/confirmation.tsx:100:7
Type error: This comparison appears to be unintentional because the types '"input-streaming" | "input-available" | "output-available" | "output-error"' and '"approval-requested"' have no overlap.
98 |
99 | // Only show when approval is requested
> 100 | if (state !== "approval-requested") {
| ^
101 | return null;
102 | }
103 |
Next.js build worker exited with code: 1 and signal: null
ELIFECYCLE Command failed with exit code 1.gauthieramano and TaQuangKhoiiibarbariTaQuangKhoi
Metadata
Metadata
Assignees
Labels
No labels