#Panic in bevy_sprite

3 messages · Page 1 of 1 (latest)

scenic lynx
#

Bit unsure what I'm doing wrong here - in the process of migrating from bevy 0.16 to bevy 0.17 and after updating I get this panic

thread 'main' (87695) panicked at /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_ecs-0.17.3/src/error/handler.rs:125:1:
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.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!

I am using DefaultFeatures and at least these features (bit unsure how to view what features are exactly enabled): bevy = { workspace = ["bevy_render", "bevy_winit", "multi_threaded", "bevy_scene", "bevy_gltf", "tonemapping_luts", "bevy_state", "zstd_rust"], default-features = false }

#

Managed to fix this by adding the bevy_text feature - but a bit confused why this is not automatically added as bevy_sprite requires it?

subtle crypt
#

You disabled defaut features, so now only features you listed are in. I assume bevy_sprite does not depend on bevy_text unless you use text. Or do you mean that you do not have any text nodes in your project and it still fails? (in that case I would consider it weird)