13

I am testing a simple todo app in Rust using the YEW framework. When I get an error, the browser console (Devmode) shows JavaScript or assembler (I tried both Chrome and Firefox). How can I get the Rust code? Do I have to setup source maps somewhere?

6

2 Answers 2

8

To achieve this you’d need WebAssembly to support sourcemaps. This is something that is being considered for future tooling, but I don’t think much progress has been made yet.

There is also an open issue for Rust sourcemap support

Sign up to request clarification or add additional context in comments.

2 Comments

In OPs cross-posted question, they claim that it's already possible.
3

This is possible now for C++. See this post. You need to install this extension and pass -g to generate debug info when compiling the C++.

Unfortunately it doesn't work in Rust yet (at least if you're using wasm-bindgen which you probably are) because wasm-bindgen discards all the DWARF info. See this post and this linked issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.