A dev run stopped before its backend loads leaves .web/nocompile, so the next run or export skips the compile
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- build-system, testing
Hướng nghiên cứu
Bắt đầu tại reflex/utils/prerequisites.py, ở get_compiled_app, rồi đọc cách App._should_compile xử lý .web/nocompile và worker backend sử dụng nó như thế nào. Thêm một kiểm thử hồi quy trong tests/units/utils/test_prerequisites.py để tạo marker và xác nhận get_compiled_app chạy biên dịch; công việc hoàn tất khi kiểm thử thất bại trước khi sửa và thành công sau đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
A dev reflex run creates .web/nocompile so that its backend worker does not compile the app a second time. Only that worker deletes the marker, when it first loads the app. If the run stops before the worker loads the app, the marker stays. The next CLI compile then consumes the marker and skips the compile:
reflex runserves the old frontend until a file save triggers a hot reload.reflex exportskips the compile, builds the old pages, and exits 0. A deploy from that machine ships the old frontend without a warning.
This is the same family as #7089. The fix in #7125 covered backend-only runs only.
Steps to reproduce
Use any app. Use explicit ports.
- Run
reflex runonce to completion, then stop it. - Run
reflex runagain. Press Ctrl+C right afterApp running at:is printed. On a small app the window is about 0.8 s. It is longer on a larger app. - Check that
.web/nocompileexists. - Change visible text in a page, for example
rx.heading("V1")torx.heading("V2"). - Do one of these:
- Run
reflex run. NoCompiling:progress bar is shown. The browser showsV1. It staysV1until you save a file. - Run
reflex export --frontend-only --no-zip. The command exits 0, but.web/build/clientcontainsV1, notV2.
- Run
Expected
A CLI command that compiles (reflex run, reflex export, reflex compile) always compiles. A marker left by an earlier run does not skip the compile.
Cause
run_backendcreates the marker when a frontend is present.App._should_compiledeletes the marker and returnsFalse. The CLI compile and the backend worker compile both call it, so a stale marker skips whichever compile runs first.
Suggested fix
The CLI paths reach the compile only through prerequisites.get_compiled_app (see the comment in App._compile). The backend worker uses App.__call__. So get_compiled_app can delete a stale marker before it compiles:
app, app_module = get_and_validate_app(reload=reload)
+ # The marker only lets the backend that a dev run starts skip its compile.
+ # A run stopped before that backend loaded leaves it behind.
+ (get_web_dir() / constants.NOCOMPILE_FILE).unlink(missing_ok=True)
app._compile(
I tested this change with the steps above:
reflex runafter the early Ctrl+C compiles and serves the new text.reflex exportafter the early Ctrl+C builds the new text.- A normal dev run still compiles once. The backend worker still consumes the marker and skips its own compile.
The fix needs a regression test, for example in tests/units/utils/test_prerequisites.py: create the marker, call get_compiled_app, and assert that a real compile ran.
- Ngôn ngữ chính
- Python
- Star
- 29k
- Fork
- 1.8k
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 143
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của reflex-dev/reflex
-
Operations on a list[T] | None var throw when the value is NoneCó thể đã có người làm @masenf đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
reflex-dev/reflex#7826 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
PropsBase nested serialization applies parent include/exclude filters to child fieldsCó thể đã có người làm @harsh21234i đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
reflex-dev/reflex#7787 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OTel: add trace_flags to JSON log records so unsampled trace ids are recognizableCó thể đã có người làm @ShaanGS đã nhận 7 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
reflex-dev/reflex#7729 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
0.9.12 changelog follow-ups: the #7132 "_get_was_touched" entry describes unreachable behaviour, #7115's hasattr/getattr change is undocumented, #7131's wordingCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
reflex-dev/reflex#7260 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ClientStateVar: a component that mounts while the value is non-default never re-renders on the push back to the defaultCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
reflex-dev/reflex#6823 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của reflex-dev/reflex
Issue tương tự
-
[Bug]: graphify query loads every language extractor just for _file_stem (about 34 ms per call)Có thể đã có người làm @rohit-jsfreaky đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Graphify-Labs/graphify#5160 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Variable declared without a value suppresses ${VAR:-default} expansionCó thể đã có người làm @Omarinho12345 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
theskumar/python-dotenv#750 ·
Maintainer thường phản hồi trong vòng 12 ngày
-
Minor bug: Main page buttonĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
[Bug]: Upfront audit metrics accept out-of-range budgets and return impossible probabilitiesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
UKGovernmentBEIS/control-arena#947 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
jasonacox/Powerwall-Dashboard#897 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày