leptos-rs / start-axum

Starter template for use with the Leptos web framework and Axum.
The Unlicense
141 stars 26 forks source link

Test fail: use of undeclared crate or module `tracing` #14

Closed srid closed 1 year ago

srid commented 1 year ago

This happens when running cargo test --profile release --package start-axum from inside the nix shell (using rust nightly):

   Doc-tests start-axum
error[E0433]: failed to resolve: use of undeclared crate or module `tracing`
  --> src/error_template.rs:25:1
   |
25 | #[component]
   | ^^^^^^^^^^^^ use of undeclared crate or module `tracing`
   |
   = note: this error originates in the attribute macro `::leptos::leptos_dom::tracing::instrument` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `tracing`
image
gbj commented 1 year ago

This fails because cargo test tries to run tests with all features. tracing is enabled only for ssr mode in this template, to keep WASM binary sizes small. Running cargo test --profile release --features=ssr --package start-axum works fine.