chinedufn / percy

Build frontend browser apps with Rust + WebAssembly. Supports server side rendering.
https://chinedufn.github.io/percy/
Apache License 2.0
2.27k stars 84 forks source link

use of undeclared type or module `Rc` #87

Closed ToJen closed 5 years ago

ToJen commented 5 years ago

Hey Chinedu, just going through the example and got this:

user:client$ ./build.sh --verbose

  [1/10] Checking `rustc` version...
  [2/10] Checking crate configuration...
  [3/10] Adding WASM target...
  info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
  [4/10] Compiling to WASM...
     Compiling client v0.1.0 (/path/to/client)
  error[E0433]: failed to resolve: use of undeclared type or module `Rc`
    --> src/lib.rs:19:20
     |
  19 |       let end_view = html!{
     |  ____________________^
  20 | |        <div class="big blue">
  21 | |           <strong>Hello, World!</strong>
  22 | |
  ...  |
  31 | |        </div>
  32 | |     };
     | |_____^ use of undeclared type or module `Rc`

  error: aborting due to previous error

  For more information about this error, try `rustc --explain E0433`.
  error: Could not compile `client`.

| To learn more, run the command again with --verbose.
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit code: 101

Here are the versions for my system:

user:client$ rustup --version
rustup 1.16.0 (beab5ac2b 2018-12-06)

user:client$ cargo --version
cargo 1.34.0-nightly (245818076 2019-01-27)

user:client$ rustc --version
rustc 1.34.0-nightly (4b1e39b7b 2019-02-05)
chinedufn commented 5 years ago

Sorry about that!

This was fixed in #86 , so if you go ahead and change your Cargo.toml to point to virtual-dom-rs = "0.6.3" you should be good to go!

ToJen commented 5 years ago

Thanks, it seems like it's still happening. Here's my new Cargo.toml:

[package]
name = "client"
version = "0.1.0"
edition = "2018"

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = "0.2.37"
js-sys = "0.3.14"
virtual-dom-rs = "0.6.3"
css-rs-macro = "0.1"

[dependencies.web-sys]
version = "0.3"
features = [
    "Document",
    "MouseEvent",
    "Window",
    "console"
]
chinedufn commented 5 years ago

Bleh my apologies - I didn't bump the html-macro version after #86

Changing to 0.6.4 (I just published it) should fix the problem!

chinedufn commented 5 years ago

Closing as this should be good to go now but please don't hesitate to let me know if things don't work for you!