iced_web icon indicating copy to clipboard operation
iced_web copied to clipboard

[Question] Error building `clock` example over the web runtime

Open yikerman opened this issue 3 years ago • 1 comments

I have copied&pasted the clock example into a binary crate with the following Cargo manifest.

[package]
name = "clock"
version = "0.1.0"
edition = "2021"

[dependencies]
iced = { git = "https://github.com/iced-rs/iced.git", features = ["canvas", "tokio", "debug"] }
iced_web = { git = "https://github.com/iced-rs/iced.git" }
chrono = "0.4"

I built with cargo build --bin clock --target wasm32-unknown-unknown following the guide. However the compiler gave an error:

error[E0432]: unresolved imports `iced::canvas`, `iced::canvas`, `iced::time`
 --> clock/src/main.rs:3:5
  |
3 |     canvas::{self, Cache, Canvas, Cursor, Geometry, LineCap, Path, Stroke},
  |     ^^^^^^   ^^^^ no `canvas` in the root
  |     |
  |     could not find `canvas` in `iced`
4 |     executor, time, Application, Color, Command, Container, Element, Length,
  |               ^^^^ no `time` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `clock` due to previous error

Am I doing something wrong? Or is canvas not supported over wasm yet?

yikerman avatar Jan 02 '22 08:01 yikerman

Or is canvas not supported over wasm yet?

That is correct. Canvas is not supported on Wasm yet!

hecrj avatar Jan 03 '22 08:01 hecrj