Wasm-pack: RuntimeError: unreachable executed

Created on 3 Oct 2019  路  3Comments  路  Source: rustwasm/wasm-pack

馃悰 Bug description

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.

馃 Expected Behavior

Shouldn't be generating a wasm that can hit an unreachable statement.

馃憻 Steps to reproduce

See https://github.com/mikedilger/circular_calendar which I have just pushed for this bug report.

馃實 Your environment

wasm-pack version: 0.8.1
rustc version: 1.38.0

Most helpful comment

@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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rpjohnst picture rpjohnst  路  5Comments

mgattozzi picture mgattozzi  路  4Comments

Bernd-L picture Bernd-L  路  3Comments

grovesNL picture grovesNL  路  4Comments

marcoscaceres picture marcoscaceres  路  3Comments