Skip to content

Crash w/ features bevy_sprite and bevy_dev_tools w/o bevy_text #21851

@weihnaxbaum

Description

@weihnaxbaum

Bevy version and features

  • 0.17.2, main (33a48a9)
  • default-features = false, features = ["bevy_sprite", "bevy_dev_tools"]

Relevant system information

  • cargo 1.93.0-nightly (2d4fa1395 2025-11-12)
  • Windows 11

What you did

fn main() -> AppExit {
    App::new().add_plugins(DefaultPlugins).run()
}

What went wrong

The app crashes with the following error (debug feature enabled for error message):

Encountered an error in system `bevy_sprite::text2d::update_text2d_layout`: Parameter `Res<'_, Assets<Font>>` failed validation: Resource does not exist
If this is an expected state, wrap the parameter in `Option<T>` and handle `None` when it happens, or wrap the parameter in `If<T>` to skip the system when it happens.
   4: bevy_ecs::error::bevy_error::impl$1::from<bevy_ecs::system::system_param::SystemParamValidationError>
             at C:\Users\yarde\.cargo\git\checkouts\bevy-50d7e162b728c6c6\33a48a9\crates\bevy_ecs\src\error\bevy_error.rs:115
   5: bevy_ecs::system::system::impl$3::from<bevy_ecs::system::system_param::SystemParamValidationError>
             at C:\Users\yarde\.cargo\git\checkouts\bevy-50d7e162b728c6c6\33a48a9\crates\bevy_ecs\src\system\system.rs:450
   6: core::result::impl$28::from_residual<tuple$<>,bevy_ecs::system::system_param::SystemParamValidationError,enum2$<bevy_ecs::system::system::RunSystemError> >
             at C:\Users\yarde\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\result.rs:2189
   7: bevy_ecs::system::system::System::run_without_applying_deferred<bevy_ecs::system::function_system::FunctionSystem<void (*)(bevy_ecs::system::system_param::Local<alloc::vec::Vec<tuple$<f32,bevy_camera::visibility::render_layers::RenderLayers>,alloc::alloc::
             at C:\Users\yarde\.cargo\git\checkouts\bevy-50d7e162b728c6c6\33a48a9\crates\bevy_ecs\src\system\system.rs:135
note: Some "noisy" backtrace lines have been filtered out. Run with `BEVY_BACKTRACE=full` for a verbose backtrace.

Encountered a panic in system `bevy_sprite::text2d::update_text2d_layout`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!

Additional information

Does not crash when:

  • removing either feature, or
  • enabling the bevy_text feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TextRendering and layout for charactersC-BugAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesP-CrashA sudden unexpected crashS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions