From dd241a1097e74ea5d0a4502afe2152d3a76aa309 Mon Sep 17 00:00:00 2001 From: Nikhil Rao Date: Tue, 9 Apr 2024 13:15:18 -0700 Subject: [PATCH] Add frontend flag to _init (#3054) --- reflex/utils/prerequisites.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 4622150f0..399724148 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -856,12 +856,16 @@ def needs_reinit(frontend: bool = True) -> bool: ) raise typer.Exit(1) + # Don't need to reinit if not running in frontend mode. + if not frontend: + return False + # Make sure the .reflex directory exists. if not os.path.exists(constants.Reflex.DIR): return True # Make sure the .web directory exists in frontend mode. - if frontend and not os.path.exists(constants.Dirs.WEB): + if not os.path.exists(constants.Dirs.WEB): return True if constants.IS_WINDOWS: