Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF-3076] 404 with recomplilation when working on routes #3416

Closed
charlestondance opened this issue Jun 1, 2024 · 2 comments · Fixed by #3592
Closed

[REF-3076] 404 with recomplilation when working on routes #3416

charlestondance opened this issue Jun 1, 2024 · 2 comments · Fixed by #3592
Labels
bug Something isn't working linear Created by Linear-GitHub Sync
Milestone

Comments

@charlestondance
Copy link

charlestondance commented Jun 1, 2024

When working with pages that are routes auto reloading leads to 404 errors that cannot be recovered without restarting reflex.

To Reproduce
Steps to reproduce the behavior:
I have an event hander in the state for the below page. If i change an invalid variable name to a correct one i can force throwing an attribute error. Switching between valid and invalid 2-3’times throws a 404 and reloading doesnt work. Restarting reflex does

This is my route:
@rx.page(route="/entity/[entity_id]/") def entity_editor():

Expected behavior
Editing pages should result in reloading a working reflex app

Screenshots
If applicable, add screenshots to help explain your problem.

Specifics (please complete the following information):

  • Python Version: 3.12
  • Reflex Version: 0.52
  • OS: osx 13.3.1
  • Browser (Optional): firefox

Additional context
Generally happens often with all sorts of editing, but reporducible with the above

REF-3076

@charlestondance charlestondance added the bug Something isn't working label Jun 1, 2024
@ElijahAhianyo
Copy link
Collaborator

can you provide a minimal reproducible code describing this behavior? I'm kind of having a hard time figuring out what the invalid/valid variable is in this case

@hragbalian
Copy link

@ElijahAhianyo Here is a minimal example:

import reflex as rx

@rx.page(
    route="/mypage/[page_id]", 
    title="Page", 
    )
def mypage():
    return rx.text("Hello world")

Navigate to page, e.g. http://localhost:3000/mypage/123/ and hot reload once or twice (maybe three times) and you'll hit the 404.

@picklelo picklelo added linear Created by Linear-GitHub Sync and removed linear Created by Linear-GitHub Sync labels Jun 12, 2024
@picklelo picklelo changed the title 404 with recomplilation when working on routes [REF-3076] 404 with recomplilation when working on routes Jun 12, 2024
@picklelo picklelo modified the milestones: v.38, v.39 Jun 13, 2024
@picklelo picklelo modified the milestones: v.39, v.40 Jun 23, 2024
masenf added a commit that referenced this issue Jun 29, 2024
Avoid race condition in hot reload that occurs when pages are removed before
they are recreated.

Fix #3416
@picklelo picklelo modified the milestones: v.40, v.41, v.42 Jun 30, 2024
masenf added a commit that referenced this issue Jul 9, 2024
* [REF-3067] Do not purge .web/pages in dev mode

Avoid race condition in hot reload that occurs when pages are removed before
they are recreated.

Fix #3416

* use constants instead of hardcoded string
Alek99 pushed a commit that referenced this issue Jul 15, 2024
* [REF-3067] Do not purge .web/pages in dev mode

Avoid race condition in hot reload that occurs when pages are removed before
they are recreated.

Fix #3416

* use constants instead of hardcoded string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linear Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants