Skip to content

Panic error when reloading a dynamic path related to reactive_graph dependency #3404

Closed Answered by gbj
CrawKatt asked this question in Q&A
Discussion options

You must be logged in to vote

By the time this finishes running

    spawn_local(async move {
        if let Err(why) = fetch_and_set_data(&guild_id, set_roles, set_channels).await {
            log!("Error fetching data: {why:#?}")
        }
    });

and tries to set the data, the entire page has already been rendered and sent to the client and has been thrown away.

If you're trying to load some async data to use in server rendering, you should be using resources and Suspense. Here's the relevant section of the docs.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by CrawKatt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants