Open
Description
Problem
Server functions using ByteStream with streaming output fail to compile in Dioxus v0.7.0-alpha.2. This worked fine in alpha.1.
Steps To Reproduce
Steps to reproduce the behavior:
Use a server function with streaming output:
use dioxus::prelude::server_fn::codec::{ByteStream, Streaming};
use dioxus::prelude::*;
#[server(output = Streaming)]
pub async fn get_file_stream() -> Result<ByteStream, ServerFnError> {
// ... implementation
}
Expected behavior
Code should compile as it did in alpha.1.
Environment:
- Dioxus version: v0.7.0-alpha.2
- Rust version: 1.83.0
- OS info: Linux
- App platform: fullstack
Questionnaire
I'm interested in fixing this myself but don't know where to start. I think the issue is:
In alpha.2, Dioxus introduced its own ServerFnError
type but ByteStream
still expects the original server_fn::ServerFnError
. The #[server]
macro and ByteStream
now use incompatible error types.
This breaking change happened in commit f610c6b (PR #4205) where:
- Alpha.1:
dioxus::prelude::ServerFnError
wasserver_fn::ServerFnError
- Alpha.2:
dioxus::prelude::ServerFnError
is now a newdioxus_fullstack::ServerFnError