Skip to content

ByteStream with #[server(output = Streaming)] fails to compile in v0.7.0-alpha.2 #4385

Open
@Himmelschmidt

Description

@Himmelschmidt

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 was server_fn::ServerFnError
  • Alpha.2: dioxus::prelude::ServerFnError is now a new dioxus_fullstack::ServerFnError

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions