myFavShrimp / turf

Macro based compile-time SCSS transpilation, CSS minification, and class name uniquification toolchain inspired by CSS modules.
MIT License
58 stars 3 forks source link

Axum askama htmx example does not work #24

Closed klownie closed 2 weeks ago

klownie commented 2 weeks ago

as the title says the example does not work. here is the compile output

error: template "counter_component.html" not found in directories ["C:\\Users\\klownie\\Documents\\Art\\PortofolioWebsite\\turfAskamaTest\\templates"]                                                                                                                                                                                                                               
 --> src/main.rs:3:10
  |
3 | #[derive(Template)]
  |          ^^^^^^^^
  |
  = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

error: template "counter_component.html" not found in directories ["C:\\Users\\klownie\\Documents\\Art\\PortofolioWebsite\\turfAskamaTest\\templates"]
 --> src/main.rs:9:10
  |
9 | #[derive(Template)]
  |          ^^^^^^^^
  |
  = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `{closure@src/main.rs:20:25: 20:27}: Handler<_, _>` is not satisfied                                                                                                                                                                                                                                                                                   
   --> src/main.rs:20:25
    |
20  |         .route("/", get(|| async { HelloTemplate { count: 0 } }))
    |                     --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Handler<_, _>` is not implemented for closure `{closure@src/main.rs:20:25: 20:27}`
    |                     |
    |                     required by a bound introduced by this call
    |
    = note: Consider using `#[axum::debug_handler]` to improve the error message
    = help: the following other types implement trait `Handler<T, S>`:
              `Layered<L, H, T, S>` implements `Handler<T, S>`
              `MethodRouter<S>` implements `Handler<(), S>`
note: required by a bound in `axum::routing::get`
   --> C:\Users\klownie\.cargo\registry\src\index.crates.io-6f17d22bba15001f\axum-0.7.7\src\routing\method_routing.rs:385:1
    |
385 | top_level_handler_fn!(get, GET);
    | ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
    | |                     |
    | |                     required by a bound in this function
    | required by this bound in `get`
    = note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `{closure@src/main.rs:23:17: 23:41}: Handler<_, _>` is not satisfied
   --> src/main.rs:23:17
    |
23  |             get(|Path(count): Path<u64>| async move { CounterTemplate { count } }),
    |             --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Handler<_, _>` is not implemented for closure `{closure@src/main.rs:23:17: 23:41}`
    |             |
    |             required by a bound introduced by this call
    |
    = note: Consider using `#[axum::debug_handler]` to improve the error message
    = help: the following other types implement trait `Handler<T, S>`:
              `Layered<L, H, T, S>` implements `Handler<T, S>`
              `MethodRouter<S>` implements `Handler<(), S>`
note: required by a bound in `axum::routing::get`
   --> C:\Users\klownie\.cargo\registry\src\index.crates.io-6f17d22bba15001f\axum-0.7.7\src\routing\method_routing.rs:385:1
    |
385 | top_level_handler_fn!(get, GET);
    | ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
    | |                     |
    | |                     required by a bound in this function
    | required by this bound in `get`
    = note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `axum-askama-htmx` (bin "axum-askama-htmx") due to 4 previous errors
klownie commented 2 weeks ago

nvm it does work the error message is just misleading