Skip to content

[wasm] Attempting to get an EventWriter for an unregistered event type panics with an unhelpful message #2139

@lukewestby

Description

@lukewestby

Bevy version

0.5.0

Operating system & version

wasm

What you did

Create a system like so:

struct Event;

fn system(mut events: EventWriter<Event>) {}

Set up the app, but do not register the event

App::build()
    .with_system(system.system())
    .run();

What you expected to happen

The application is misconfigured so I expect this to panic, and ideally the message for the panic would explain that a system attempted to fetch an EventWriter for an unregistered event type.

What actually happened

The application panics with the following:

panicked at 'assertion failed: `(left == right)`
  left: `true`,
 right: `false`: cannot recursively acquire mutex',

and upon further examination of the stack trace it turns out to be the failure described by #1924

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with BevyS-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