From eb57930ca23741dda1eb22d631c31e5a9022bd16 Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Wed, 27 Mar 2024 23:11:24 +0100 Subject: [PATCH] link to rustwasm doc + cleaner message (through include_str) --- src/lib.rs | 2 +- static/error_web_sys_unstable_apis.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 static/error_web_sys_unstable_apis.txt diff --git a/src/lib.rs b/src/lib.rs index 41477b21f..03a2f0587 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,7 +55,7 @@ target_arch = "wasm32", not(web_sys_unstable_apis) ))] -compile_error!("bevy_egui uses unstable APIs to support clipboard on web, please add `--cfg=web_sys_unstable_apis` in your rustflags or disable the `bevy_egui::manage_clipboard` feature."); +compile_error!(include_str!("../static/error_web_sys_unstable_apis.txt")); /// Egui render node. #[cfg(feature = "render")] diff --git a/static/error_web_sys_unstable_apis.txt b/static/error_web_sys_unstable_apis.txt new file mode 100644 index 000000000..7b07db435 --- /dev/null +++ b/static/error_web_sys_unstable_apis.txt @@ -0,0 +1,6 @@ +bevy_egui uses unstable APIs to support clipboard on web. + +Please add `--cfg=web_sys_unstable_apis` to your rustflags or disable the `bevy_egui::manage_clipboard` feature. + +More Info: https://rustwasm.github.io/wasm-bindgen/web-sys/unstable-apis.html + \ No newline at end of file