#4815·leptos

leptos_macro version 0.8.17 generates invalid code when compiled against leptos 0.8.19

Author: TethysSvenssonCreated Jun 25, 2026Updated Jun 25, 2026

Describe the bug

The PR #4711 introduced a change in leptos_macro that requires a recent version of the leptos crate in order to compile when using --cfg=erase_components.

This change was released today as part of [email protected].

However the leptos crate does not pin the version of leptos_macro. This means running cargo update can break your code if you update one of the crates without also updating the other.

To Reproduce

As of today this will not compile:

bash
cargo new reproducer
cd reproducer
cargo add leptos@=0.8.19
RUSTFLAGS="--cfg=erase_components" cargo check

However if you also add a constraint on leptos_macro, then it will:

bash
cargo new reproducer2
cd reproducer2
cargo add leptos@=0.8.19
cargo add leptos_macro@=0.8.16
RUSTFLAGS="--cfg=erase_components" cargo check

Additional context

This issue was found while I was trying to create a work-around for #4814.