From 34ab5fd878613c22e228feae4043b719c07b13b0 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 24 Oct 2024 11:54:45 -0700 Subject: [PATCH] try being a little smart --- reflex/compiler/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 40640faa6..29398da87 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -83,6 +83,12 @@ def validate_imports(import_dict: ParsedImportDict): f"{_import.tag}/{_import.alias}" if _import.alias else _import.tag ) if import_name in used_tags: + already_imported = used_tags[import_name] + if (already_imported[0] == "$" and already_imported[1:] == lib) or ( + lib[0] == "$" and lib[1:] == already_imported + ): + used_tags[import_name] = lib if lib[0] == "$" else already_imported + continue raise ValueError( f"Can not compile, the tag {import_name} is used multiple time from {lib} and {used_tags[import_name]}" )