I'm using wasm-pack to build a wasm that generates an SVG on the fly. Code compiles with no error. The resulting wasm worked fine up until I added a line (and included chrono), and now the browser gives me "RuntimeError: unreachable executed" and I can inspect into the wasm to an unreachable statement.
Shouldn't be generating a wasm that can hit an unreachable statement.
See https://github.com/mikedilger/circular_calendar which I have just pushed for this bug report.
wasm-pack version: 0.8.1
rustc version: 1.38.0
Now that I think of it, it's probably related to chrono and time.
@mikedilger You should be using console_error_panic_hook, which will dramatically improve the error messages.
For chrono you need to enable the wasmbind feature.
Oh man is that valuable information! Thanks.
Most helpful comment
@mikedilger You should be using
console_error_panic_hook, which will dramatically improve the error messages.For
chronoyou need to enable thewasmbindfeature.