Can I use YEW in production?

I am trying to rum the todo app in the YEW framework (examples folder). I cloned the project and followed the default instructions. The todo app runs but crashes when I try to use it. I tried Chrome and Firefox and some older releases of the framework. Given that it’s impossible to get an error stack trace in Rust in the browser, is there any way to debug a YEW application? Also, given that I cannot run some of the YEW examples, is the framework stable enough for production?

The logging to console works fine with Yew. See the web_logger crate ( ).

Here’s an example yew app we went through at the Rustfest 2018 yew workshop:

Hope this helps! Agree no stacktrace yet for wasm, but that’s got to be really high on the todo list for this year.

1 Like

You mentioned the exampled didn’t work, you’ve probably done this, but for the rust wasm you need to:

cargo install cargo-web

and then rather than cargo run you execute cargo web start If I remember correctly. (And also install the wasm target via rustup)

1 Like

I’ve done all of that. The todo app compiles and runs, but when I try to do something it usually crashes after I enter a few tasks. I was wondering if I have to use Rust nightly build (I’m using the latest Rust stable).

That is my console in Firefox:

pre-main prep time: 4 ms
DEBUG:yew::html::onkeypress – Event handler: KeyPressEvent
Encountered a panic!
Panic error message: already borrowed: BorrowMutError
Panic location: libcore/
DEBUG:yew::html::oninput – Event handler: InputEvent
Input: a
uncaught exception: 5321952
Source map error: request failed with status 404
Resource URL:
Source Map URL:[Learn More]

It actually fails with emscripten with borrowing of a scheduler. But it will work reliable and faster if you will use --target wasm32-unknown-unknown target.

On other hand this bug has disappeared with a new scheduler which I’ll merge soon:

It’s possible to use it for a production project, but the framework continues to improve and could get some backward incompatible changes. You should take this risk into account. But the framework already is so close to a consistent state.


I had some trouble to get the nightly build running but it worked. The todo example is working fine.

1 Like