Skip to content

'bevy_render::maths' import path not found on web #19226

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

Closed
Vrixyz opened this issue May 16, 2025 · 1 comment · Fixed by #19266
Closed

'bevy_render::maths' import path not found on web #19226

Vrixyz opened this issue May 16, 2025 · 1 comment · Fixed by #19266
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds O-WebGL2 Specific to the WebGL2 render API

Comments

@Vrixyz
Copy link
Member

Vrixyz commented May 16, 2025

Bevy version

main as of 1395152.

System information

cargo 1.87.0 (99624be96 2025-05-06)
MacOS Sequoia ; on arc

AdapterInfo { name: "ANGLE (Apple, ANGLE Metal Renderer: Apple M3 Pro, Unspecified Version)", vendor: 4203, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "WebGL 2.0 (OpenGL ES 3.0 Chromium)", backend: Gl }

What you did

Run cargo run --example extended_material --target wasm32-unknown-unknown

What went wrong

Example is not running correctly:

 INFO app: crates/bevy_render/src/batching/gpu_preprocessing.rs:1130 GPU preprocessing is not supported on this device. Falling back to CPU preprocessing.
 WARN app: crates/bevy_core_pipeline/src/oit/resolve/mod.rs:83 OrderIndependentTransparencyPlugin not loaded. GPU lacks support: DownlevelFlags::FRAGMENT_WRITABLE_STORAGE.
 WARN app: crates/bevy_pbr/src/ssao/mod.rs:92 ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
 WARN app: crates/bevy_pbr/src/atmosphere/mod.rs:170 AtmospherePlugin not loaded. GPU lacks support for compute shaders.
 INFO app: crates/bevy_core_pipeline/src/dof/mod.rs:824 Disabling depth of field on this platform because depth textures aren't supported correctly
ERROR app: crates/bevy_render/src/render_resource/pipeline_cache.rs:1034 failed to process shader:
error: required import 'bevy_render::maths' not found
    ┌─ crates/bevy_core_pipeline/src/tonemapping/tonemapping_shared.wgsl:335:13
    
335      color = powsafe(color * gain + lift, 1.0 / gamma);
                 ^
    
    = missing import 'bevy_render::maths'


ERROR app: crates/bevy_render/src/render_resource/pipeline_cache.rs:1034 failed to process shader:
error: required import 'bevy_render::maths' not found
   ┌─ crates/bevy_pbr/src/render/mesh_functions.wgsl:18:12
   
18      return affine3_to_square(mesh[instance_index].world_from_local);
               ^
   
   = missing import 'bevy_render::maths'

Additional notes

To be noted, on firefox on the same machine, I'm having the same error as:

@Vrixyz Vrixyz added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 16, 2025
@Vrixyz Vrixyz added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds O-WebGL2 Specific to the WebGL2 render API and removed S-Needs-Triage This issue needs to be labelled labels May 16, 2025
@mockersf
Copy link
Member

started with #19137

pull bot pushed a commit to kinglew/bevy that referenced this issue May 17, 2025
…evyengine#19266)

# Objective

- transitive shader imports sometimes fail to load silently and return
Ok
- Fixes bevyengine#19226

## Solution

- Don't return Ok, return the appropriate error code which will retry
the load later when the dependencies load

## Testing

- `bevy run --example=3d_scene web --open`


Note: this is was theoretically a problem before the hot reloading PR,
but probably extremely unlikely to occur.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds O-WebGL2 Specific to the WebGL2 render API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants