Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Component Missing in Helpers Menu #5595

Closed
ThomaciousD opened this issue Jan 8, 2025 · 2 comments · Fixed by #5626
Closed

Custom Component Missing in Helpers Menu #5595

ThomaciousD opened this issue Jan 8, 2025 · 2 comments · Fixed by #5626
Labels
bug Something isn't working

Comments

@ThomaciousD
Copy link
Contributor

Bug Description

In the Langflow UI, the Custom Component option is missing under the Helpers menu. According to the documentation, this feature should allow users to create and integrate custom components directly within Langflow, but the UI does not provide an option for adding them.

Reproduction

  1. Install Langflow version 1.1.1 and set up the application.
  2. Open the Langflow UI.
  3. Navigate to the Helpers menu.
  4. Observe that the Custom Component option is not available.

Expected behavior

The Helpers menu should include the Custom Component option, allowing users to drag it into the workspace and define custom components as described in the Langflow documentation.

Who can help?

@ogabrielluiz

Operating System

Google Cloud Kubernetes Engine

Langflow Version

1.1.1

Python Version

None

Screenshot

image

Flow File

No response

@ThomaciousD ThomaciousD added the bug Something isn't working label Jan 8, 2025
Copy link

dosubot bot commented Jan 8, 2025

Hey @ThomaciousD! I'm here to help you with any bugs, questions, or contributions you have for Langflow. Feel free to ask me anything!

The issue of the missing Custom Component option in the Langflow UI could be related to several factors. Here are some steps to troubleshoot and potentially resolve the problem:

  1. Environment Variable or CLI Argument: Ensure that the LANGFLOW_COMPONENTS_PATH environment variable is correctly set to the path of your custom components directory, or use the --components-path argument when running the Langflow CLI. This is necessary for the custom components to be recognized and loaded into the UI [1].

  2. Folder Setup: Verify that the directory structure for your custom components is correctly set up, with a custom_components subdirectory containing your components. This setup is crucial for the components to appear in the UI [1].

  3. Dependencies and Conditions: Make sure that all dependencies and conditions required for the Custom Component feature are met. This includes creating a class that inherits from CustomComponent and using Type Annotations in the build method [1].

  4. Check for Feature Flags: Although there is no specific information about feature flags or configuration settings that might hide the Custom Component option, it is worth checking any configuration files or settings that might control UI visibility.

  5. Recent Changes or Updates: Consider reviewing recent updates or commits in the Langflow repository that might have affected the display of the Custom Component option. This could include changes in the UI codebase or any conditional logic that might prevent the option from being displayed.

If these steps do not resolve the issue, further investigation into the codebase or reaching out to someone familiar with recent changes, like @ogabrielluiz, might be necessary.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@ThomaciousD
Copy link
Contributor Author

Hi everyone,

After further investigation, I discovered the root cause of the issue. The problem lies in how custom components are structured and organized within the directory specified by the LANGFLOW_COMPONENTS_PATH environment variable.

Root Cause:
Custom components in Langflow must adhere to a specific directory structure to be properly recognized and displayed in the UI. Specifically:

Components need to be placed inside category subfolders within the LANGFLOW_COMPONENTS_PATH base directory.
These category subfolders determine where the components will appear in the Langflow UI (e.g., under "Helpers").
Resolution:
By ensuring that my custom components followed the correct directory structure, the Custom Component option appeared as expected in the UI.

Here’s the proper structure for reference:


/app/custom_components/          # LANGFLOW_COMPONENTS_PATH
    ├── helpers/                 # Shows up as "Helpers" menu
    │   └── custom_component.py  # Your component
    └── tools/                   # Shows up as "Tools" menu
        └── tool_component.py    # Another component

Next Steps:
To help others avoid this confusion, I’m proposing an update to the documentation to clarify the directory structure requirements for custom components. I’ve created a pull request with these changes, which I hope will provide clearer guidance for future users.

If you encounter similar issues, double-check the directory structure and restart the Langflow application after making adjustments.

I’ve submitted a pull request to address this issue: #5626

github-merge-queue bot pushed a commit that referenced this issue Jan 10, 2025
* Update custom components documentation (Fixes #5595)

* docs: cleanup

---------

Co-authored-by: Mendon Kissling <[email protected]>
mieslep pushed a commit to mieslep/langflow that referenced this issue Jan 15, 2025
…langflow-ai#5626)

* Update custom components documentation (Fixes langflow-ai#5595)

* docs: cleanup

---------

Co-authored-by: Mendon Kissling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant