diff --git a/packages/fullstack/src/render.rs b/packages/fullstack/src/render.rs index ea179207f8..adb38ac4c4 100644 --- a/packages/fullstack/src/render.rs +++ b/packages/fullstack/src/render.rs @@ -10,6 +10,7 @@ use std::future::Future; use std::sync::Arc; use std::sync::RwLock; use tokio::task::JoinHandle; +use tokio::task::block_in_place; use crate::prelude::*; use dioxus_lib::prelude::*; @@ -64,7 +65,7 @@ impl SsrRendererPool { let prev_context = SERVER_CONTEXT.with(|ctx| ctx.replace(server_context)); // poll the future, which may call server_context() tracing::info!("Rebuilding vdom"); - vdom.rebuild(&mut NoOpMutations); + block_in_place(|| vdom.rebuild(&mut NoOpMutations)); vdom.wait_for_suspense().await; tracing::info!("Suspense resolved"); // after polling the future, we need to restore the context @@ -124,7 +125,7 @@ impl SsrRendererPool { .with(|ctx| ctx.replace(Box::new(server_context))); // poll the future, which may call server_context() tracing::info!("Rebuilding vdom"); - vdom.rebuild(&mut NoOpMutations); + block_in_place(|| vdom.rebuild(&mut NoOpMutations)); vdom.wait_for_suspense().await; tracing::info!("Suspense resolved"); // after polling the future, we need to restore the context