You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use bevy::prelude::*;use bevy::tasks::{AsyncComputeTaskPool,Task};use bevy_async_ecs::*;#[derive(Component)]structTaskHolder(Task<()>);#[derive(Component,Clone)]structData;fnmain(){App::new().add_plugins((DefaultPlugins,AsyncEcsPlugin)).add_systems(Startup, |world:&mutWorld| {let async_world = AsyncWorld::from_world(world);letmut entity = world.spawn(());let id = entity.id();let fut = asyncmove{
async_world.entity(id).wait_for::<Data>().await;};let task = AsyncComputeTaskPool::get().spawn(fut);
entity.insert(TaskHolder(task));}).add_systems(Update, |task_holders:Query<Entity,With<TaskHolder>>,mutcommands:Commands| {for entity in task_holders.iter(){
commands.entity(entity).insert(Data);
commands.entity(entity).remove::<TaskHolder>();}}).run();}
gives me
thread 'main' panicked at /home/avi/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5:
invariant broken: Closed(..)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_async_ecs::command::apply_commands`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
2025-03-05T06:02:53.528311Z ERROR wgpu_hal::gles::egl: EGL 'eglDestroyContext' code 0x3008: EGL_BAD_DISPLAY error: In eglDestroyContext: Invalid EGLDisplay (0x63c2f63eb9f0)
thread '<unnamed>' panicked at /home/avi/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/khronos-egl-6.0.0/src/lib.rs:841:27:
called `Option::unwrap()` on a `None` value
this isn't an exact replication of what i'm actually doing in my application but it's something around these lines, e.g. storing a .wait_forTask in a component and dropping it close to when it's probably completing, the error i actually get in my application is
thread 'main' panicked at /home/avi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5:
invariant broken: Closed(..)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2025-03-05T05:57:32.532370Z WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2025-03-05T05:57:32.532435Z WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2025-03-05T05:57:32.532450Z WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
thread 'IO Task Pool (2)' panicked at /home/avi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5:
invariant broken: RecvError
Encountered a panic in system `bevy_async_ecs::command::apply_commands`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
The text was updated successfully, but these errors were encountered:
repro:
gives me
this isn't an exact replication of what i'm actually doing in my application but it's something around these lines, e.g. storing a
.wait_for
Task
in a component and dropping it close to when it's probably completing, the error i actually get in my application isThe text was updated successfully, but these errors were encountered: