diff --git a/reflex/components/dynamic.py b/reflex/components/dynamic.py index a133db5a1..4df89330a 100644 --- a/reflex/components/dynamic.py +++ b/reflex/components/dynamic.py @@ -93,7 +93,7 @@ def load_dynamic_serializer(): for lib, names in component._get_all_imports().items(): formatted_lib_name = format_library_name(lib) if ( - not lib.startswith((".", "/")) + not lib.startswith((".", "$/")) and not lib.startswith("http") and formatted_lib_name not in libs_in_window ): @@ -109,7 +109,7 @@ def load_dynamic_serializer(): # Rewrite imports from `/` to destructure from window for ix, line in enumerate(module_code_lines[:]): if line.startswith("import "): - if 'from "/' in line: + if 'from "$/' in line: module_code_lines[ix] = ( line.replace("import ", "const ", 1).replace( " from ", " = window['__reflex'][", 1