diff --git a/src/backend/langflow/api/v1/endpoints.py b/src/backend/langflow/api/v1/endpoints.py index ca5e1c5c9..56ca36d6f 100644 --- a/src/backend/langflow/api/v1/endpoints.py +++ b/src/backend/langflow/api/v1/endpoints.py @@ -57,6 +57,13 @@ def get_all(): logger.info(f"Loading {len(custom_component_dicts)} category(ies)") for custom_component_dict in custom_component_dicts: # custom_component_dict is a dict of dicts + if len(custom_component_dict) > 1: + raise ValueError( + f"Custom components must be in a single category. Found {len(custom_component_dict)} categories" + ) + elif len(custom_component_dict) == 0: + continue + category = list(custom_component_dict.keys())[0] logger.info( f"Loading {len(custom_component_dict[category])} component(s) from category {category}"