Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion reflex/utils/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ def notify_frontend(url: str, backend_present: bool):

def notify_backend():
"""Output a string notifying where the backend is running."""
config = get_config()
console.print(
f"Backend running at: [bold green]http://0.0.0.0:{get_config().backend_port}[/bold green]"
f"Backend running at: [bold green]http://{config.backend_host}:{config.backend_port}[/bold green]"
)
Comment on lines +162 to 165
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Config object called as a function — TypeError at runtime

get_config() returns a Config instance, not a callable. Assigning it to config and then invoking config() on line 164 (twice) will raise TypeError: 'Config' object is not callable every time notify_backend() is called.

The attributes should be accessed directly on the object returned by get_config():

Suggested change
config = get_config()
console.print(
f"Backend running at: [bold green]http://0.0.0.0:{get_config().backend_port}[/bold green]"
f"Backend running at: [bold green]http://{config().backend_host}:{config().backend_port}[/bold green]"
)
config = get_config()
console.print(
f"Backend running at: [bold green]http://{config.backend_host}:{config.backend_port}[/bold green]"
)



Expand Down