Skip to content

Commit 069a205

Browse files
fix: do not crash if app is not a child of the current working directory
1 parent e1befdd commit 069a205

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

solara/__main__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,14 @@ def run(
341341
reload_excludes = restart_excludes if restart_excludes else []
342342
del restart_excludes
343343
reload_excludes = [str(solara_root / "website"), str(solara_root / "template")]
344-
reload_excludes.append(app)
344+
app_path = Path(app)
345+
if app_path.exists():
346+
# if app is not a child of the current working directory
347+
# uvcorn crashes
348+
if str(app_path.resolve()).startswith(str(Path.cwd().resolve())):
349+
reload_excludes.append(str(app_path.resolve()))
350+
print("reload_excludes", reload_excludes)
351+
del app_path
345352
del solara_root
346353
reload = True
347354
# avoid sending many restarts

0 commit comments

Comments
 (0)