[BUG] message stopped and Error: Cannot read properties of undefined (reading 'length')
Describe the bug I follow a video demo that how create a Software development team with agents.
To Reproduce Steps to reproduce the behavior:
-
run chat
-
ask "Build a To Do list app"
-
chat:
AI
Hi there! How can I help?
Me
build a to do list app
AI
agentPNG
Supervisor
Build a to-do list app
agentPNG
Product Designer
To-Do List App Design Requirements
Overview
The To-Do List App is a mobile and web application designed to help users manage their tasks and increase productivity. The app will allow users to create, organize, and prioritize their to-do lists, set reminders, and track their progress.
Core Features
Task Management
Users can create new tasks with description, due date, and priority level (low, medium, high)
Tasks can be organized into categories (folders) and subcategories
Users can add attachments to tasks (photos, documents, etc.)
Task List View
A list view of all tasks, filtered by category, priority, and due date
Users can toggle tasks as completed
Reminders
Users can set reminders for tasks, with customizable notification times and frequencies (e.g., daily, weekly)
Reminders can be sent via email, push notifications, or in-app notifications
Customization
Users can customize their task list view with sorting, filtering, and grouping options
Users can change their theme, font size, and other visual settings
Syncing and Backup
Tasks will be synced across devices via cloud storage (Google Drive, Dropbox, etc.)
Users can export their task list to CSV or PDF for backup or sharing
Integrations
Integration with popular calendar apps (Google Calendar, Apple Calendar, etc.) for automatic task synchronization
Integration with productivity apps (Trello, Asana, etc.) for seamless task management
User Interface
Home Screen
A clean and simple home screen with a prominent task list view
Tap-to-create interface for adding new tasks
Task Detail Screen
A detailed view of selected tasks with editable fields (description, due date, priority)
Attachment display and editing functionality
Settings Screen
A dedicated settings screen for theme, font size, and other customizations
Syncing and backup options (cloud storage, export, etc.)
Technical Requirements
Backend
Use a cloud-based backend (Firebase, AWS, etc.) for task storage and syncing
Implement RESTful API for task management and integration with other apps
Frontend
Build the UI using a popular frontend framework (React, Angular, etc.)
Use a mobile-optimized CSS framework (Bootstrap, Material-UI, etc.)
Mockup
Here's a rough mockup of the To-Do List App UI:
Home Screen
Task list view with tap-to-create interface
Filter and sorting options
Prominent call-to-action for adding new tasks
Task Detail Screen
Task summary with editable fields
Attachment display and editing functionality
Settings Screen
Theme picker
Font size slider
Syncing and backup options
Next Steps
Develop the core features and UI components
Implement task management and syncing functionality
Integrate with calendar and productivity apps
Conduct user testing and gather feedback
Iterate on design and functionality based on feedback
This design meets the core requirements for the To-Do List App. The next steps involve developing the UI components and implementing the core features.
agentPNG
Supervisor
Design the UI for the To-Do List App
agentPNG
Product Designer
Next Steps: Design Development
Based on the design requirements, I will focus on developing the UI components and implementing the core features.
Task Management Component
I will design a reusable Task Management component that includes:
Task summary with editable fields (description, due date, priority)
Attachment display and editing functionality
Filter and sorting options
jsx
// TaskManagement.js
import React from 'react';
import { Feather } from 'react-feather';
const TaskManagement = ({ task, onEdit, onDelete }) => {
return (
<div className="task-management">
<h2>{task.name}</h2>
<p>{task.description}</p>
<p>
<span>
<Feather icon="calendar" /> Due Date: {task.dueDate}
</span>
</p>
<p>
<span>
<Feather icon="alert-triangle" /> Priority: {task.priority}
</span>
</p>
<div className="attachments">
{task.attachments.map((attachment, index) => (
<a key={index} href={attachment.url}>
{attachment.name}
</a>
))}
</div>
<button onClick={onEdit}>Edit</button>
<button onClick={onDelete}>Delete</button>
</div>
);
};
export default TaskManagement;
Task List Component
I will design a Task List component that includes:
List view of all tasks
Filtering and sorting options
Toggle for completing tasks
jsx
// TaskList.js
import React from 'react';
import { Feather } from 'react-feather';
const TaskList = ({ tasks, onToggle, onFilter }) => {
return (
<div className="task-list">
<h2>Task List</h2>
<ul>
{tasks.map((task, index) => (
<li key={index}>
<TaskManagement
task={task}
onEdit={() => console.log('Edit task')}
onDelete={() => console.log('Delete task')}
/>
<button onClick={() => onToggle(task.id)}>
<Feather icon="check" />
</button>
</li>
))}
</ul>
<button onClick={onFilter}>Filter</button>
</div>
);
};
export default TaskList;
Settings Component
I will design a Settings component that includes:
Theme changer
Font size slider
Syncing and backup options
jsx
// Settings.js
import React from 'react';
import { Feather } from 'react-feather';
const Settings = () => {
return (
<div className="settings">
<h2>Settings</h2>
<button>Change Theme</button>
<button>Font Size</button>
<button>Syncing and Backup</button>
</div>
);
};
export default Settings;
Home Component
I will design a Home component that includes:
Home screen with task list view
Tap-to-create interface for adding new tasks
jsx
// Home.js
import React from 'react';
import { Feather } from 'react-feather';
import TaskList from './TaskList';
const Home = () => {
return (
<div className="home">
<h2>Home</h2>
<TaskList />
<button>
<Feather icon="plus" />
Add Task
</button>
</div>
);
};
export default Home;
This is a basic implementation of the UI components and core features of the To-Do List App. The next steps involve integrating the components, implementing the backend API, and conducting user testing.
AI
Cannot read properties of undefined (reading 'length')
- get error "message stopped"
- log error
flowise-1 | 2024-07-28 19:55:31 [INFO]: ⬆️ POST /api/v1/internal-prediction/2fd02c0e-d0ed-42cb-b0c8-742b26329a90
flowise-1 | 2024-07-28 19:55:31 [INFO]: [server]: Chatflow 2fd02c0e-d0ed-42cb-b0c8-742b26329a90_38348c3b-1073-4cdb-84c3-cdf2de3526cd added into ChatflowPool
flowise-1 | 2024-07-28 19:55:38 [ERROR]: [server]: Error: Cannot read properties of undefined (reading 'length')
flowise-1 | TypeError: Cannot read properties of undefined (reading 'length')
flowise-1 | at utilBuildAgentResponse (/usr/src/packages/server/dist/utils/buildChatflow.js:388:33)
flowise-1 | at async utilBuildChatflow (/usr/src/packages/server/dist/utils/buildChatflow.js:159:20)
flowise-1 | at async createInternalPrediction (/usr/src/packages/server/dist/controllers/internal-predictions/index.js:7:29)
flowise-1 | 2024-07-28 19:55:38 [ERROR]: [server]: Error: Cannot read properties of undefined (reading 'length')
flowise-1 | Error: Cannot read properties of undefined (reading 'length')
flowise-1 | at utilBuildAgentResponse (/usr/src/packages/server/dist/utils/buildChatflow.js:451:15)
flowise-1 | at async utilBuildChatflow (/usr/src/packages/server/dist/utils/buildChatflow.js:159:20)
flowise-1 | at async createInternalPrediction (/usr/src/packages/server/dist/controllers/internal-predictions/index.js:7:29)
Setup
Escenario 1:
- Installation docker flowise/flowise (2.0.1)
- Browser Firefox
Escenario 2:
- build docker image from main@e39fd130d0836a1b1dc6c4027552deddd854c7fe
- Browser Firefox
both with the same error.
EDIT: in the Software Development Team Agents.json file the LLM temperature should be 0.
I have the same issue.
Yes, that happens because the LLM is actually not giving any output. If you turn on the analytic using langsmith/langfuse or others, you will see that.
You will need to use a "smarter" model
Thanks @HenryHengZJ
Re: Smarter Model I am currently getting this this using 4o, and I will need to verify, but I feel like I also saw it it with Sonnet 3.5 as well (don't quote me).
One thing to add, is that the state of the message window breaks when this happens as well. If you close and reopen it after this issue the messages generated before the failure disappear and you may need to clear the chat several times to get it to render and act properly.
I'm getting the same error and it seems to work sometimes and sometimes it fails. I'm using ChatGoogleGenerativeAI in my flow. Error: predictionsServices.buildChatflow - Cannot read properties of undefined (reading 'length')
Also getting this out of nowhere, using Prompt Engineering Team running on Groq - Llama 3.1 70b - not had an issue with it until now. It was working fine.
Error: predictionsServices.buildChatflow - Cannot read properties of undefined (reading 'length')
Update GPT 4o does indeed throw out this error but then still continues with the request, and produces one empty Agent Messages bubble, and one completed agent message bubble, not sure if that helps locate the bug? @HenryHengZJ
I have the same issue and would appreciate a solution
Tried many models, have the same issue with all of them at this point.
I also have the same issue, was looking for a solution.
I made the necessary adjustments by removing all special characters, indentations, and single quotes from the supervisor and worker node prompt text. After these updates, it seems to be working fine on my end, but I'm not sure—maybe it will work for you as well.
@xor83 Great! Thanks for the update, I will try this. But @HenryHengZJ this seems to be a widespread problem. For me the problem got worse to the point where every chat model, smarter or not, now returns this error in Sequential Agents / Agentflows
This does not seem to be getting picked up but is a major bug, effecting many users. Maybe we all make a separate post on this it will be picked up?
I think to solve this problem, what we can do is to add a retry mechanism or a fallback failed message. Because the underlying issue is that LLM does not give any output, hence causing the error.
If the LLM is the issue by not generating output, how do I understand what it's being asked to do and what is being returned?
Same here. Nothing works. All I get is "Cannot read properties of undefined (reading 'length')"
Did somebody make ANY progress on this?
@HenryHengZJ
I am having the same error, but still working (locally and cloud)
If it helps this is what shows in Langsmith:
metadata: {}
runtime library: "langchain-js"
RENDER_GIT_COMMIT: "8bb55e07b63d12407fccf66dd04e83bf7d72e67c"
runtime: "node"
sdk: "langsmith-js"
sdk_version: "0.1.6"
Run:
Aborted!
Error: Aborted! at agentNode (/usr/src/packages/components/dist/nodes/multiagents/Supervisor/Supervisor.js:614:15) at async RunnableLambda.supervisorNode [as func] (/usr/src/packages/components/dist/nodes/multiagents/Supervisor/Supervisor.js:582:57) at async /usr/src/node_modules/.pnpm/@[email protected][email protected]_@[email protected]_@aws-sdk+credential-provid_7neqxdzwpbrflib37usagtazcm/node_modules/@langchain/core/dist/runnables/base.cjs:1513:34
I'm having the same issue, new to flowise and really can't help but from what I've read here it seems to be affecting alot of people
Completely new to Flowise. Was keen to try it for the multi-agent function, but unfortunately, running into this same issue.
If the LLM is the issue by not generating output, how do I understand what it's being asked to do and what is being returned?
you can turn on the the analytics for that. if anyone can send me an analytic trace link that would be great. Perhaps @nextgen101 if you have one
I just got the following in Langsmith after getting the same error if Cannot read properties of undefined (reading 'length'):
Aborted!
Error: Aborted! at agentNode (/usr/src/packages/components/dist/nodes/multiagents/Worker/Worker.js:241:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async RunnableLambda.workerNode [as func] (/usr/src/packages/components/dist/nodes/multiagents/Worker/Worker.js:107:53) at async /usr/src/node_modules/.pnpm/@[email protected][email protected]_@[email protected]_@aws-sdk+credential-provid_7neqxdzwpbrflib37usagtazcm/node_modules/@langchain/core/dist/runnables/base.cjs:1513:34
Completely new to Flowise. I met the same issue when trying this tutorial.【三分钟零代码创建AI智能体工作流!开源免费Flowise超越Coze和dify!打造复杂多AI Agents协作任务!轻松驾驭多智能体协作!#Flowise-哔哩哔哩】 https://b23.tv/RKNK7Yo
"Devepoler" instead of "Developer" <<<------------------ I fixed the spelling on this and it worked right away, it showed the
"message stopped and Error: Cannot ~ ~ ~ ~ ~ 'length') error before i changed the spelling.
Here is working file:
Error: predictionsServices.buildChatflow - TypeError: Cannot read properties of null (reading 'name') what could it be?