Skip to content

dev_tool example has wrong import #19200

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

Open
Saratii opened this issue May 13, 2025 · 4 comments
Open

dev_tool example has wrong import #19200

Saratii opened this issue May 13, 2025 · 4 comments
Labels
A-Dev-Tools Tools used to debug Bevy applications. C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@Saratii
Copy link

Saratii commented May 13, 2025

Bevy version

0.16.0

What you did

Copy paste example from https://github.com/bevyengine/bevy/blob/latest/examples/dev_tools/fps_overlay.rs

What went wrong

Failed to compile because the import is wrong.

  • what were you expecting?
    it to compile
  • what actually happened?
    error[E0433]: failed to resolve: could not find dev_tools in bevy
@Saratii Saratii added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 13, 2025
@Saratii
Copy link
Author

Saratii commented May 13, 2025

#19201

@greeble-dev
Copy link
Contributor

greeble-dev commented May 13, 2025

I don't believe the fps_overlay example is wrong - that style of import is normal for Bevy examples.

What does the bevy dependency in your app's Cargo.toml look like? You might need to enable the bevy_dev_tools feature:

bevy = { version = "0.16", features = ["bevy_dev_tools"] }

I tried copy and pasting the fps_overlay example into a standalone crate - adding the feature seemed to make it work.

@greeble-dev greeble-dev added C-Examples An addition or correction to our examples S-Needs-Investigation This issue requires detective work to figure out what's going wrong A-Dev-Tools Tools used to debug Bevy applications. and removed S-Needs-Triage This issue needs to be labelled labels May 13, 2025
@britalmeida
Copy link

I had the same issue and enabling the feature fixed it. ✔

Can this information be added to the example?
I just started trying out Bevy by following the Getting Started and then trying to kitbash examples together until I have a window (title, res, vsync), logging, and a defined framerate policy before moving on to input and finally start making my game.
I'm very early on and had no clue about "features".
I think it could be fairly common for complete beginners to start by getting an FPS counter on screen.

@greeble-dev
Copy link
Contributor

I've filed a PR that will help a bit - it will encourage the compiler to say "I couldn't import dev_tools because the app is missing the bevy_dev_tools feature". I don't think this is a complete fix as someone might not know how to enable the feature, but it should be a small step forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dev-Tools Tools used to debug Bevy applications. C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

3 participants