https://linen.dev logo
Tools compatibility issue, vercel ai, Cannot read ...
# 🖥│support-forum
s
"@composio/core": "^0.1.53", "@composio/vercel": "^0.2.9", "ai": "^4.2.9", "@ai-sdk/anthropic": "^1.2.8", "use server" import { Composio } from '@composio/core'; import { generateText } from 'ai'; import { anthropic } from '@ai-sdk/anthropic'; import { VercelProvider } from '@composio/vercel'; type TestResult = { success: boolean result: string | null error?: string toolsCount: number } export async function runComposioTest(): Promise { try { // Use a unique identifier for each user in your application const userId = ''; // Initialize Composio toolset const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY, provider: new VercelProvider(), }); // Get all tools for the user const tools = await composio.tools.get(userId, { toolkits: ['linear'], limit: 10, }); console.log(tools) // Generate a deep research on hackernews const { text } = await generateText({ model: anthropic('claude-sonnet-4-20250514'), messages: [ { role: 'user', content: 'test linear tools', }, ], tools, }); return { success: true, result: text, toolsCount: Array.isArray(tools) ? tools.length : 0 }; } catch (error) { console.error('Error running Composio test:', error); return { success: false, error: error instanceof Error ? error.message : 'Unknown error occurred', result: null, toolsCount: 0 }; } }
Error running Composio test: TypeError: Cannot read properties of undefined (reading '_def') at Array.map () at async runComposioTest (file://C%3A/Users/sagar/Desktop/development/work/nextjs/swarm/new/SwarmLabs/reasoning-stack/src/lib/test.ts:35:25) 33 | 34 | // Generate a deep research on hackernews > 35 | const { text } = await generateText({ | ^ 36 | model: anthropic('claude-sonnet-4-20250514'), 37 | messages: [ 38 | {
c
Hey there, looks like your
ai
lib is not latest, could you try updating your
ai
to latest?
"ai": "^5.0.60"
s
could you please confirm is the tools are not compatible with v4, is it mandatory to use v5 of vercel ai
hey, please confined
c
Hey, some tools might not be compatible with v4. We recommend using v5, alternatively you can use an older version of the SDK.
s
okay, but i am not able to create new integrations when using v1, getting cannot read properties of undefined reading message,
c
Could you share the reproducible code snippet?