-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[wasm] Attempting to get an EventWriter for an unregistered event type panics with an unhelpful message #2139
Comments
FYI you don't need to register the event with add_event, merely create a resource for it. I agree that the error message should be much better though. |
Adding the resource would remove this particular error, but the event would not be functioning without the managing system (added e.g. via |
It will work just fine, it'll just lack automatic cleanup. This pattern is actually quite useful for when you need events to function for systems that sleep (like if they operate on a fixed time step); you just need to handle cleaning them up on your own so the memory use doesn't grow in an unbounded fashion. I'm working on an
Agreed, although it should also point to |
Cleaning up the error messages here would be a nice step forward, and should be quite approachable for a new contributor. |
I recommend we close this; |
Bevy version
0.5.0
Operating system & version
wasm
What you did
Create a system like so:
Set up the app, but do not register the event
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:
and upon further examination of the stack trace it turns out to be the failure described by #1924
The text was updated successfully, but these errors were encountered: