DioxusLabs/dioxus · error

No root component provided for headless FullstackState

Error message

No root component provided for headless FullstackState

What it means

Code attempted to access the root component of a FullstackState created via headless(). Headless states intentionally have no root component (the SsrRendererPool was built with None), so any API that needs to render a root page panics.

Source

Thrown at packages/fullstack-server/src/server.rs:238

    renderers: Arc<SsrRendererPool>,
    pub(crate) rt: LocalPoolHandle,
}

impl FullstackState {
    /// Create a headless [`FullstackState`] without a root component.
    ///
    /// This won't render pages, but can still be used to register server functions and serve static assets.
    pub fn headless() -> Self {
        let rt = LocalPoolHandle::new(
            std::thread::available_parallelism()
                .map(usize::from)
                .unwrap_or(1),
        );

        Self {
            renderers: Arc::new(SsrRendererPool::new(4, None)),
            build_virtual_dom: Arc::new(|| {
                panic!("No root component provided for headless FullstackState")
            }),
            config: ServeConfig::new(),
            rt,
        }
    }

    /// Create a new [`FullstackState`]
    pub fn new<M: 'static>(
        config: ServeConfig,
        root: impl ComponentFunction<(), M> + Send + Sync + 'static,
    ) -> Self {
        let rt = LocalPoolHandle::new(
            std::thread::available_parallelism()
                .map(usize::from)
                .unwrap_or(1),
        );

        Self {

View on GitHub (pinned to 24f6a829df)

Solutions

  1. Pass a root component when building the headless FullstackState, e.g. with_root or the constructor that takes the app component.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at packages/fullstack-server/src/server.rs:238 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/774ace780cb7e10d. Report an issue: GitHub.