# Axum panics with "Path segments must not start with `:`". How do I fix it?
Source: https://ruststudio.org/community/t/160/axum-panics-with-path-segments-must-not-start-with-how-do-i-fix-it
Author: Ruststudio Team (staff) | Published: 2026-12-05 | Updated: 2026-12-05 | Checked with: rustc 1.93.0, axum 0.8.9, Windows 11; the panic below is the real output of the program shown
Category: Help and questions | Kind: Troubleshooting | Tags: axum, routing, troubleshooting, upgrading | Views: 0

## Short answer
Axum 0.8 changed the path syntax from /:id and /*rest to /{id} and /{*rest}. A route written the old way panics when the Router is built. Change the colon form to braces, or call without_v07_checks on the router if you really need a literal colon.

## Answer
## Symptom
The program panics at start-up, while the router is being built:

```text
thread 'main' (43060) panicked at examples\f04.rs:7:38:
Path segments must not start with `:`. For capture groups, use `{capture}`. If you meant to literally match a segment starting with a colon, call `without_v07_checks` on the router.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

It comes from code like this:

```rust title=src/main.rs
use axum::{extract::Path, routing::get, Router};

async fn show(Path(id): Path<u32>) -> String { format!("user {id}") }

#[tokio::main]
async fn main() {
    let _app: Router = Router::new().route("/users/:id", get(show));
    println!("router built");
}
```

## Cause
Axum 0.8 uses `{name}` for a parameter and `{*name}` for a wildcard. The older `:name` and `*name` forms from axum 0.7 and earlier are rejected when the route is added, so the mistake shows at start-up and not on the first request.

## Fix
```rust
Router::new().route("/users/{id}", get(show));      // was "/users/:id"
Router::new().route("/files/{*path}", get(rest));   // was "/files/*path"
```

If a path really contains a literal segment that starts with a colon, the panic message names the way out: call `without_v07_checks` on the router.

## Common mistakes
- Fixing one route and stopping. The panic names the file and line of the first bad route only, so run again after each fix until the router builds.
- Copying a tutorial written for axum 0.6 or 0.7. Check the axum version in the tutorial against your `Cargo.toml`.

## Related questions
### Is the change only for paths?
This thread covers only paths. Other 0.8 changes are listed in the axum changelog.

## Sources
- axum changelog: https://github.com/tokio-rs/axum/blob/main/axum/CHANGELOG.md (read 2026-12-05)
- axum, `Router`: https://docs.rs/axum/0.8.9/axum/struct.Router.html (read 2026-12-05)
