瀏覽代碼

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 'from "$/' in line or 'from "/' in line:
                     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: