Skip to content

Apps created with create-tauri-app with yew fail to compileΒ #122

Description

@lpiepiora
❯ yarn create tauri-app
yarn create v1.22.18
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
[4/4] πŸ”¨  Building fresh packages...

success Installed "create-tauri-app@2.0.0" with binaries:
      - create-tauri-app
[###] 3/3
βœ” Project name Β· tauri-app-yew
βœ” Choose your package manager Β· cargo
βœ” Choose your UI template Β· yew

Please follow https://tauri.app/v1/guides/getting-started/prerequisites to install the needed prerequisites, if you haven't already.
You also need to install tauri-cli (cargo install tauri-cli) and trunk (https://trunkrs.dev/#install)

Done, Now run:
  cd tauri-app-yew
  cargo tauri dev

✨  Done in 15.17s.

Then when compiling following error is shown:

cargo tauri dev
.... cut irrelevant information ...
   Compiling tauri-app-yew-ui v0.0.0 (/private/tmp/tauri-app-yew)
error[E0599]: no function or associated item named `from_serde` found for struct `wasm_bindgen::JsValue` in the current scope
  --> src/app.rs:40:34
   |
40 |                         JsValue::from_serde(&GreetArgs { name: &*name }).unwrap(),
   |                                  ^^^^^^^^^^ function or associated item not found in `wasm_bindgen::JsValue`
   |
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
1  | use gloo_utils::format::json::JsValueSerdeExt;
   |
help: there is an associated function with a similar name
   |
40 |                         JsValue::from_str(&GreetArgs { name: &*name }).unwrap(),
   |                                  ~~~~~~~~

For more information about this error, try `rustc --explain E0599`.
error: could not compile `tauri-app-yew-ui` due to previous error
2022-08-22T18:11:41.228453Z ERROR ❌ error
error from HTML pipeline

Caused by:
    0: error from asset pipeline
    1: error during cargo build execution
    2: cargo call returned a bad status

The reason is that there are missing features in the dependencies:

serde = { version = "1.0.140", features = ["derive"] }                                                                                                                   
wasm-bindgen = { version = "0.2.82", features = ["serde-serialize"] }

(I'll follow up with a PR)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions