Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

[Question] Error building clock example over the web runtime #12

@yikerman

Description

@yikerman

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions