Compiler breaks when `dev` feature is active without the `3d` one

Open
#26,618 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start by tracing bevy_dev_tools::render_debug::init_render_debug_overlay_pipeline and the feature gates for the dev, 2d, and 3d features; the reported failure is a missing MeshPipelineViewLayouts resource with 3d disabled. Check the related fix in issue #23673 and reproduce with the listed Bevy features. Done when the dev feature works with 2d and ui without default features, and the relevant regression test passes.

Written by the indexing model from the issue text.

Description

C-Bug S-Needs-Triage

Bevy version and features

I am using Bevy 0.20.1 with default-features disabled : default-features = false, features = ["2d", "ui", "dev"].

What you did

I just started a fresh project were I wanted to work on some 2D game. So I disabled the default features, only to allow 2d and ui. This works perfectly well, but as soon as I also added the dev feature too (to monitor framerate, entities, etc.) the compiler breaks.

You can see my cargo.toml here :

[package]
name = "jeu"
version = "0.1.0"
edition = "2024"

[dependencies]
bevy = { version = "0.20.1", default-features = false, features = ["2d", "ui", "dev"] }
rand = "0.10.4"

# Enable a small amount of optimization in the dev profile.
[profile.dev]
opt-level = 1

# Enable a large amount of optimization in the dev profile for dependencies.
[profile.dev.package."*"]
opt-level = 3

What went wrong

Here is the error message when compiling with the dev feature without the default-features :

thread 'main' (11376) panicked at /home/xxxxxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_ecs-0.20.1/src/error/handler.rs:128:1:
Encountered an error in system `bevy_dev_tools::render_debug::init_render_debug_overlay_pipeline`: Parameter `Res<MeshPipelineViewLayouts>` failed validation: Resource does not exist
If this is an expected state, wrap the parameter in `Option<T>` and handle `None` when it happens, or wrap the parameter in `If<T>` to skip the system when it happens.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2026-11-20T09:20:43.562720Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562725Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562729Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562732Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562737Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562741Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562744Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562748Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562750Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562754Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562757Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562761Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562767Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562771Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?

Additional information

From what I've seen, this migh be an issue caused by the absence of some features available in the 3d feature that are used by the dev one (something about pbr, but I am not quite sure what it is).

A similar issue has been posted and marked as resolve (https://github.com/bevyengine/bevy/issues/23673) but it seems that is is still not working.

Dominant language
Rust
Stars
49.8k
Forks
5.1k
Avg merge
3d 4h
Merged PRs (30d)
136

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bevyengine/bevy

All issues in bevyengine/bevy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.