Server-side data fetching not re-rendering
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 32.8k
- Forks
- 1.5k
- Avg merge
- 5h 34m
- Merged PRs (30d)
- 2
Description
Problem
Merging the server-side rendering+data-fetching example, and the server-side routing example results in empty renders when navigating back to the component that uses server-side fetching.
It's entirely possible I've made a mistake in transcribing the examples, but I can't
Steps To Reproduce
Steps to reproduce the behavior:
- I combine the examples here in this repository (ignore the Bazel stuff, that's additional work)
trunk build index.htmlcargo run --features=ssr --bin simple_ssr_server -- --dir dist/- Navigate to
localhost:8081– see nav + random uuid rendered - Click the "Hi" link – see nav + "Hi" rendered
- Use the back button, or click the "Home" link – see only nav rendered
- Reload the root page - see nav + random uuid rendered
Expected behavior
Either cached value from the first render, or re-render with a new random uuid
Screenshots
Initial load:

After clicking "hi" link:

Clicking "home" or via browser back button:

Environment:
- Yew version: yew: 0.20.0 yew-router: 0.17.0
- Rust version: 1.64.0
- Browser and version, if relevant: Safari 16.1 & Chrome 107.0.5304.121
Questionnaire
- I'm interested in fixing this myself but don't know where to start
- I would like to fix and I have a solution
- I don't have time to fix this right now, but maybe later
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the yew-ssr-bazel example and the commands trunk build index.html and cargo run --features=ssr --bin simple_ssr_server -- --dir dist/. Trace the server-side fetching and routing behavior when navigating from the root to “Hi” and back, then verify that the root renders its cached or newly fetched UUID instead of only the navigation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100