Skip to content

hydration error when multiple adjacent components in a tree suspend with use_server_future #4595

@painedpineapple

Description

@painedpineapple

Problem

If I have 2 components that each fetch data (and suspend) via use_server_future()? inside a parent. When this happens dixous seems to get confused at how to deserialize the data and mixes up the types.

Steps To Reproduce

Steps to reproduce the behavior:

I have a repo that has this error being reproduced here. I used this in another ticket but pushed a change that replicates this.

In the app I'm developing each component is fetching a Vec of a struct. These structs are different. I notice that I get an error for each struct b/c the deserializer can't find the first field on the struct. If I comment out one of the components they other deserializes just fine.

Expected behavior

I can suspend as many components as needed and they will be able to correctly deserialize their data on hydration.

Screenshots
From the repro repo:

Image

Environment:

  • Dioxus version: dioxus 0.7.0-rc.0 (593945e)
  • Rust version: rustc 1.89.0
  • OS info: 6.15.9-arch1-1
  • App platform: web

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfullstackrelated to the fullstack crate

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions