Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwrap error when using ButtonBundle #44

Closed
hafiidz opened this issue Jul 15, 2023 · 3 comments
Closed

Unwrap error when using ButtonBundle #44

hafiidz opened this issue Jul 15, 2023 · 3 comments

Comments

@hafiidz
Copy link
Contributor

hafiidz commented Jul 15, 2023

Hi, I am encountering consistent crash & couldn't get the button text to show up when I tried to enter a simple ButtonBundle. I have tested when removing the ButtonBundle, the rest of the MenuPlay.prototype.ron is working fine. It seems to be happening during state transition, i.e. when moving away for the spawned menu (i.e. despawning).

(
  name: "MenuPlay",
  schematics: {
    "bevy_proto::custom::NodeBundle": (
      style: (
        flex_direction: Row,
        justify_content: SpaceAround,
        align_items: Center,
        size: (
          width: Auto,
          height: Px(64.0),
        ),
      ),
      background_color: (Rgba(
        red: 0.5,
        green: 0.15,
        blue: 0.15,
        alpha: 1.0
      )),
    )
  },
  children: [(
        value: Inline((
          name: "Play Button",
          schematics: {
            "bevy_proto::custom::ButtonBundle": (
              style: (
                size: (
                  width: Px(64.0),
                  height: Px(32.0),
                ),
              ),
            ),
          },
          children: [(
            value: Inline((
              name: "Play Text",
              schematics: {
                "bevy_proto::custom::TextBundle": (
                  text: (
                    sections: [(
                      // Label for Play Button
                      value: "Play",
                      style: (
                        font: AssetPath("fonts/FiraSans-Bold.ttf"),
                        font_size: 15.0,
                        color: White,
                      )
                    )]
                  ),
                ),
              }
            ))
          )]
        ))
      ),
  ]
)
thread 'Compute Task Pool (5)' panicked at 'called `Option::unwrap()` on a `None` value', C:\Users\hafiidz\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ui-0.10.1\src\render\mod.rs:608:70
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'Compute Task Pool (5)' panicked at 'A system has panicked so the executor cannot continue.: RecvError', C:\Users\hafiidz\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_ecs-0.10.1\src\schedule\executor\multi_threaded.rs:194:60
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', C:\Users\hafiidz\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_tasks-0.10.1\src\task_pool.rs:376:49
thread 'Compute Task Pool (5)' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', C:\Users\hafiidz\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_render-0.10.1\src\pipelined_rendering.rs:136:45
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', C:\Users\hafiidz\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_tasks-0.10.1\src\task_pool.rs:376:49
error: process didn't exit successfully: `target\debug\deck_proto.exe` (exit code: 101)

Not sure what else do I need to provide here to help diagnose the problem.

@hafiidz
Copy link
Contributor Author

hafiidz commented Jul 25, 2023

Just updating this with a reproducible simple example. Do note that I am using a local bevy_proto with one minor changes to lock to bevy=0.10.1 version, as mentioned in PR#45 to avoid versioning conflict.

Working okay with a normal node:
https://github.com/hafiidz/bevy_snippets/tree/main

Cannot run with error with Button Bundle:
https://github.com/hafiidz/bevy_snippets/tree/add-button-bundle

The changes are only in assets/MenuPlay.prototype.ron as outlined here:

hafiidz/bevy_snippets@dd45444

@MrGVSV
Copy link
Owner

MrGVSV commented Jul 28, 2023

@hafiidz is this still an issue with #45? Trying to replicate it myself and I'm not getting a panic (when using that branch anyways).

@hafiidz
Copy link
Contributor Author

hafiidz commented Jul 28, 2023

A quick update, manage to get it running properly now. Thank you very much!

@hafiidz hafiidz closed this as completed Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants