Skip to content
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

[Merged by Bors] - fix scene_viewer example on wasm #4426

Closed

Conversation

jakobhellermann
Copy link
Contributor

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.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Apr 5, 2022
@jakobhellermann jakobhellermann added C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds and removed S-Needs-Triage This issue needs to be labelled labels Apr 5, 2022
@mockersf
Copy link
Member

mockersf commented Apr 5, 2022

I've had a similar issue with this unwrap could you instead have it unwrap_or_else(|| ".".to_string())?

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much cleaner. Good suggestion :)

@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Apr 5, 2022
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.
@bors
Copy link
Contributor

bors bot commented Apr 5, 2022

Build failed:

@alice-i-cecile
Copy link
Member

bors retry

bors bot pushed a commit that referenced this pull request Apr 5, 2022
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.
@bors bors bot changed the title fix scene_viewer example on wasm [Merged by Bors] - fix scene_viewer example on wasm Apr 5, 2022
@bors bors bot closed this Apr 5, 2022
aevyrie pushed a commit to aevyrie/bevy that referenced this pull request Jun 7, 2022
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.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants