You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue where extract run from within server functions failed to extract anything. After lots of head-banging and confusion, I discovered that layers had to be added after routes. So, IOW:
let router = axum::Router::new()
.serve_dioxus_application(ServeConfigBuilder::new(), App)
.layer(Extension(redis))
.layer(Extension(s3))
.into_make_service();
instead of:
let router = axum::Router::new()
.layer(Extension(redis))
.layer(Extension(s3))
.serve_dioxus_application(ServeConfigBuilder::new(), App)
.into_make_service();
I recognize that this is technically documented on the Axum side, but it's a bit indirect as it needs you to recognize that .serve_dioxus_application is setting up your routes, and that layers need to be added before. Even so, if there's some way to document it on the Dioxus side, or to make the Dioxus server setup immune to this somehow, that'd have saved me a few hours of debugging.
Thanks a bunch.
The text was updated successfully, but these errors were encountered:
I ran into an issue where
extract
run from within server functions failed to extract anything. After lots of head-banging and confusion, I discovered that layers had to be added after routes. So, IOW:instead of:
I recognize that this is technically documented on the Axum side, but it's a bit indirect as it needs you to recognize that
.serve_dioxus_application
is setting up your routes, and that layers need to be added before. Even so, if there's some way to document it on the Dioxus side, or to make the Dioxus server setup immune to this somehow, that'd have saved me a few hours of debugging.Thanks a bunch.
The text was updated successfully, but these errors were encountered: