DioxusLabs / DioxusLabs/dioxus

dx serve: "Serving your app" banner prints before the build is ready

Open Beginner friendly
#5,744 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

`dx serve` prints the "ready" banner (`Serving your app: {bin}! 🚀 ...`) as soon as the dev server socket is up, before the first build has even started, let alone completed. The message text implies the app is ready to use, but at the point it's printed, `builder.initialize()` hasn't been called yet and no `BuilderUpdate::BuildReady` has been received - so the compiled bundle doesn't exist on disk yet.

This is more than cosmetic: any script or workflow that treats the banner as a readiness signal (e.g. tailing CLI output before copying/reading `target/dx/.../public/`) can race the actual build and find nothing there. In one repro, the banner printed ~27s before the build finished.

Root cause: in `serve_all()` (`packages/cli/src/serve/mod.rs`), the banner is a plain statement that runs before `builder.initialize()`:

```rust
let mut builder = AppServer::new(args).await?;
let mut devserver = WebServer::start(&builder)?; // devserver socket up
let mut screen = Output::start(builder.interactive).await?;

tracing::info!(r#"... Serving your app: {binname}! 🚀 ..."#); // fires here

builder.initialize(); // build only starts here

loop {
// BuilderUpdate::BuildReady arrives later, in this loop
...
}
```

**Steps To Reproduce**

- Run `dx serve --web` (or any platform) on a project with a non-trivial build time.
- Note the timestamp of the "Serving your app" banner vs. the timestamp of "Build completed successfully ... launching app! 💫".
- Observe the banner prints first, well before the build/launch line - and before any bundle exists on disk.

**Expected behavior**

The readiness banner should only print once the app has actually been built and opened for the first time (i.e. alongside/after "Build completed successfully ... launching app!"), not before the build has started.

**Environment:**

- Dioxus version: main @ 710f46d150e60686ae8d1b2498d17a3b5bcdc9b3 (post-0.8.0-alpha.1)
- Rust version: 1.93.1
- OS info: macOS 26 (Darwin 25.1.0)
- App platform: web (reproduced with a minimal `dioxus::launch` app), but the ordering bug is platform-independent

**Questionnaire**

I would like to fix and I have a solution.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in packages/cli/src/serve/mod.rs, especially serve_all(), and trace the current ordering of WebServer::start(), the readiness banner, builder.initialize(), and BuilderUpdate::BuildReady. Move the banner's readiness point to the first completed build and verify that it no longer precedes build completion or bundle availability.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.