Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

reflex run --frontend-only / --backend-only fails when rxconfig sets the ports

未关闭 适合新手
#7,686 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@ybai08 已经在做这个了。

开始于 2026年10月29日。

  • #7693 来自 @ybai08 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend, cli

调研方向

issue 指向 reflex/reflex.py 中的 run() 和 _run();阅读配置端口的应用方式,以及单侧模式如何验证端口。检查 reflex run --frontend-only 和 --backend-only 的现有测试,然后补充对已配置端口和显式端口标志的测试。完成条件是:已配置的端口不再阻止单侧运行,而针对未运行一侧的显式标志仍会报错。

由索引模型根据 Issue 内容生成。

描述

Problem

reflex run --frontend-only and reflex run --backend-only exit at once when rxconfig.py sets frontend_port or backend_port.

Repro
# rxconfig.py
import reflex as rx

config = rx.Config(app_name="app", frontend_port=3653, backend_port=8653)
$ reflex run --env prod --frontend-only
Cannot specify --backend-port when not running backend.
$ reflex run --env prod --backend-only
Cannot specify --frontend-port when not running frontend.

The same happens in dev. No port flag is given on the command line.

Cause

run() in reflex/reflex.py fills both ports from the config before it calls _run():

frontend_port = frontend_port or config.frontend_port
backend_port = backend_port or config.backend_port

_run() then rejects a port for the side that does not run. It cannot tell a port from the config from a --frontend-port / --backend-port flag.

Expected

A port from the config does not block a single-side run. Only an explicit flag for the side that does not run is an error. Moving the config fallback below the running-mode check would do this.

Workaround

Remove the ports from rxconfig.py and pass --frontend-port or --backend-port to each run.

主要语言
Python
星标
29k
派生
1.8k
平均合并
3 天 5 小时
30 天内合并 PR
187

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

reflex-dev/reflex 的其他 Issue

查看 reflex-dev/reflex 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。