소스 검색

fix imports with alias from $ (#4332)

Khaleel Al-Adhami 6 달 전
부모
커밋
a454b705a8
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      reflex/components/dynamic.py

+ 3 - 3
reflex/components/dynamic.py

@@ -111,9 +111,9 @@ def load_dynamic_serializer():
             if line.startswith("import "):
             if line.startswith("import "):
                 if 'from "$/' in line or 'from "/' in line:
                 if 'from "$/' in line or 'from "/' in line:
                     module_code_lines[ix] = (
                     module_code_lines[ix] = (
-                        line.replace("import ", "const ", 1).replace(
-                            " from ", " = window['__reflex'][", 1
-                        )
+                        line.replace("import ", "const ", 1)
+                        .replace(" as ", ": ")
+                        .replace(" from ", " = window['__reflex'][", 1)
                         + "]"
                         + "]"
                     )
                     )
                 else:
                 else: