Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues When Running #78

Closed
parker-codes opened this issue Apr 1, 2021 · 8 comments
Closed

Issues When Running #78

parker-codes opened this issue Apr 1, 2021 · 8 comments
Labels
C-bug Category: bug, something isn't working

Comments

@parker-codes
Copy link

I can't seem to get the Hello World example from the README running. I have updated my main.rs file and added the dependency to Cargo.toml, but when I run using trunk I get a long list of errors (see below).

Environment

  • Maple: 0.4.x
  • WSL / Ubuntu 20.04.1 LTS

Additional context
I have updated trunk, wasm-pack-cli, Rust, and a few other dependencies I think are related, just in case.

Here is the start of the output. The list goes on for quite a while longer.

❯ trunk serve --open
Apr 01 07:16:47.612  INFO 📦 starting build
Apr 01 07:16:47.616  INFO spawning asset pipelines
Apr 01 07:16:47.775  INFO building maple-test
   Compiling js-sys v0.3.49
   Compiling console_error_panic_hook v0.1.6
error: expected `,`
  --> /home/googlemac/.cargo/registry/src/github.com-1ecc6299db9ec823/console_error_panic_hook-0.1.6/src/lib.rs:80:43
   |
80 |             #[wasm_bindgen(js_namespace = console)]
   |                                           ^^^^^^^

error[E0433]: failed to resolve: use of undeclared type `Error`
   --> /home/googlemac/.cargo/registry/src/github.com-1ecc6299db9ec823/console_error_panic_hook-0.1.6/src/lib.rs:106:21
    |
106 |             let e = Error::new();
    |                     ^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
71  | use std::error::Error;
    |
71  | use std::io::Error;
    |
71  | use wasm_bindgen::__rt::core::fmt::Error;
    |

error[E0425]: cannot find function `error` in this scope
   --> /home/googlemac/.cargo/registry/src/github.com-1ecc6299db9ec823/console_error_panic_hook-0.1.6/src/lib.rs:117:13
    |
117 |             error(msg);
    |             ^^^^^ not found in this scope

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0425, E0433.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `console_error_panic_hook`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: expected `,`
   --> /home/googlemac/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.49/src/lib.rs:639:39
    |
639 |         #[wasm_bindgen(js_namespace = Atomics, catch)]
    |                                       ^^^^^^^

error: expected `,`
   --> /home/googlemac/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.49/src/lib.rs:649:39
@parker-codes parker-codes added the C-bug Category: bug, something isn't working label Apr 1, 2021
@lukechu10
Copy link
Collaborator

Sorry, I can't reproduce. May I ask what Rust compiler version you are using?

@lukechu10
Copy link
Collaborator

Also know that all the examples are hosted on maple-rs.netlify.app/example/example-name (so the hello world example would be at maple-rs.netlify.app/example/hello)

@parker-codes
Copy link
Author

rustc 1.51.0 (2fd73fabe 2021-03-23)

I should clarify I'm following the steps in the Getting Started section of the README, so not the actual Hello World example.

@lukechu10
Copy link
Collaborator

It seems to be an error with console_error_panic_hook. And also the README.md is slightly out of date. The example should be

render(|| root);

But that doesn't seem to be the cause of the error you posted. Could I take a look at your Cargo.toml please?

@lukechu10
Copy link
Collaborator

Could I also see any other code you have?

@parker-codes
Copy link
Author

@lukechu10
Copy link
Collaborator

Hmm, I fixed it by running cargo update. Not sure what the problem was there

@parker-codes
Copy link
Author

Crazy. Sorry to bother you! 😄 It works now, so I can try more advanced things!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug, something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants