Reflex App Stuck in Compilation Preparation Stage After Offline Changes (windows)

I am encountering an issue with Reflex (0.6.7) where the app consistently gets stuck at the initial stage when I run reflex run. Here’s a full example of how it looks:

Info: Overriding config value db_url with env var DB_URL=***
Warning: Windows Subsystem for Linux (WSL) is recommended for improving initial install times.

The issue arises after I make multiple changes to the app offline. Even when I restart VS Code, the app remains stuck in this state. It does not proceed to the next stage, which typically looks like this:

────────────────────────────────────────────────────────────── Starting Reflex App ───────────────────────────────────────────────────────────────
[15:03:36] Compiling: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 13/13 0:00:00
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [13644] using StatReload
App running at: http://localhost:3000
Backend running at: http://0.0.0.0:8000


The only workaround I have found is to reboot my Windows system, which allows the app to compile and run successfully. Waiting does not resolve the issue (tested up to 60 minutes multiple times).

Additional Context:

  • I frequently make changes offline and attempt to run the app locally.
  • The app appears to get stuck specifically during the preparation stage for compilation, even before starting the Reflex backend or frontend.

Question:
Is there a way to bypass this issue and force Reflex to proceed with compiling and running the app without requiring a full system reboot?

I also had few problems when I saved any changes, the compilation process sometimes would get stuck, but I only needed to close the terminal, open a new one and run reflex again. This happened a lot and it was frustrating so I followed the β€œtip” Reflex gives you and moved all my project to WSL. It works perfectly and the compilation process is way faster. Tbh I didn’t even know what WSL was, it will take you few hours to install and migrate your project specially if you have a DB connection to Postgres for example but it’s 100% worth it. In the end you will most likely set up your project on a Linux server. I hope this helps.

1 Like

@Greg does this happen just for a particular app? or are you able to reproduce it with a blank app?

I’m a bit unclear on what β€œmake changes offline” refers to. As I understand it, you stop the app, edit the code, and then reflex run again, and it never actually starts compiling?

One thing to check when you get into this state is if there is a file .web\nocompile in your project directory. This is a marker file that reflex uses internally to avoid compiling in some circumstances, but it’s possible it’s getting left around and blocking compilation even when it shouldn’t be.

Hi @masenf

That is correct for the majority of the cases! This happens quite a lot, but there are cases out of this many when reflex stops itself because of a wrong change during rendering - a change in code that stops the selfhosting. On those cases - event though i change back the code how it was, and i run β€˜reflex run’ never actually starts compiling. Not when i run the β€˜reflex run’ in a new terminal not even if i restart VS coding app. Only if i reboot the os, reflex run work on the same project.

Many thanks for the note, I’ll check that!