danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, AWS, OpenAI, Assistants API, Azure, Groq, o1, GPT-4o, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.
https://librechat.ai/
MIT License
17.87k stars 2.96k forks source link

[Bug]: Unexpected Error When Mentioning Assistants (@) – TypeError: Cannot Read Property 'map' of Undefined #4105

Closed hanna-daoud closed 1 week ago

hanna-daoud commented 1 week ago

What happened?

When I attempt to mention assistants in the chat by typing @ and selecting one, I receive an unexpected error in the application. The error prevents me from proceeding with the assistant selection and crashes the input field.

Expected Behavior: I expected to see a list of available assistants and to be able to select one without the application crashing.

Environment: Branch: Main Operating System: Ubuntu 24.04 Browser: Chrome Version 128.0.6613.137 (Official Build) (64-bit) Node.js Version: v20.17.0

Steps to Reproduce

  1. Open LibreChat.
  2. Start a new chat and type @ in the input field.
  3. Try to select any assistant from the dropdown menu.
  4. The application crashes, and an error is displayed.

What browsers are you seeing the problem on?

Chrome

Relevant log output

Unexpected Application Error!
Cannot read properties of undefined (reading 'map')
TypeError: Cannot read properties of undefined (reading 'map')
    at Mention (Mention.tsx:159:43)
    at renderWithHooks (chunk-AXVHJUCK.js:21682:26)
    ...

I am running the application in debug mode, and the error occurs in the Mention.tsx file on line 159. Here's the relevant part of the code:

{(matches as MentionOption[]).map((mention, index) => (

Screenshots

image image

Code of Conduct