You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Panicked with 'called Result::unwrap() on an Err value: Custom("invalid value: integer 4984270261285729579, expected usize")' after compiling to WebAssembly and running on nodejs
#277
Closed
JohnGouwar opened this issue
Jan 18, 2022
· 2 comments
Edit parse function in the following way in src/lib.rs
#[wasm_bindgen]pubfnparse(string:&str) -> u64{
console_error_panic_hook::set_once();let lexerdef = calc_l::lexerdef();let lexer = lexerdef.lexer(string);// Pass the lexer to the parser and lex and parse the input.let(res, _) = calc_y::parse(&lexer);match res {Some(r) => r.unwrap(),
_ => panic!("Failed to parse expression"),}}
OS: Ubuntu 20.04 64 bit
Steps to reproduce bug:
0) Follow Quickstart guide from grmtools book.
src/lib.rs
My initial conjecture is that there is a cast between u64 and usize somewhere, which does not work with the Wasm architecture.
The text was updated successfully, but these errors were encountered: