bevycheck
Bevycheck helps debug bevy errors by adding procedural macros which display nice error messages.
Disclaimer
bevycheck
can't figure out all valid system parameters, for example, custom types with #[derive(SystemParam)]
won't work. If you find a type that should work but get's reported, please file an issue.
This crate is meant as a temporary measure to figure out why something doesn't compile, but shouldn't be kept in the final code.
Bevy support table
bevy | bevy-inspector-egui |
---|---|
main | unreleased |
Invalid Systems
If you get an error like
no method named "system" found for fn item "for<'r, 's> fn(Query<'r, &'s Component>, Commands) {my_system}" in the current scope "my_system" is a function, perhaps you wish to call it
the trait bound "Component: WorldQuery" is not satisfied the trait "WorldQuery" is not implemented for "Component"
simply add #[bevycheck::system]
to your function and helpful error messages will appear.
error: invalid system parameter
-/test.rs:4:21
|
4 |
| ^^^^^^^^^^^^^
|
= help: use `mut commands: Commands`
error: invalid query parameter
-/test.rs:4:58
|
4 |
| ^^^^^^^^^^^^^^^
|
= note: `GlobalTransform` is not a valid query type
= help: if you want to query for a resource, use `&GlobalTransform` or `&mut GlobalTransform`
error: aborting due to 2 previous errors
error: could not compile `bevycheck`
To learn more, run the command again with --verbose.
Bevy support table
bevy | beyvcheck |
---|---|
0.5 | 0.1 |