From 7e3637c36fab1f95ad31731dd75d5242a02db471 Mon Sep 17 00:00:00 2001 From: Jakob Hellermann Date: Tue, 5 Apr 2022 20:45:06 +0000 Subject: [PATCH] fix scene_viewer example on wasm (#4426) The scene viewer example doesn't run on wasm because it sets the asset folder to `std::env::var("CARGO_MANIFEST_DIR").unwrap()`, which isn't supported on the web. Solution: set the asset folder to `"."` instead. --- examples/tools/scene_viewer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tools/scene_viewer.rs b/examples/tools/scene_viewer.rs index 2ae16a2502..a66256b80b 100644 --- a/examples/tools/scene_viewer.rs +++ b/examples/tools/scene_viewer.rs @@ -40,7 +40,7 @@ Controls: brightness: 1.0 / 5.0f32, }) .insert_resource(AssetServerSettings { - asset_folder: std::env::var("CARGO_MANIFEST_DIR").unwrap(), + asset_folder: std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string()), watch_for_changes: true, }) .insert_resource(WindowDescriptor {