Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic using stdweb #387

Closed
JackMordaunt opened this issue Jan 18, 2020 · 2 comments
Closed

panic using stdweb #387

JackMordaunt opened this issue Jan 18, 2020 · 2 comments

Comments

@JackMordaunt
Copy link

I have searched extensively, so please excuse me if this has been addressed.

I'm using stdweb api and compiling with cargo web.
My wasm module panics with a "not implemented".
I have tried all feature options including default-features = false, js-sys and wasm-bindgen.

(Obviously, with wasm-bindgen I get Error loading Rust wasm module 'calendar': TypeError: "import object field '__wbindgen_placeholder__' is not an Object")

It's unclear what exact line of of my code produces the panic, but it appears to be the time crate causing the panic.

Screen Shot 2020-01-18 at 6 02 01 PM

// time 0.1.42, line 102
pub fn get_time() -> (i64, i32) {
    unimplemented!()
}

The only types I'm using are use chrono::{Duration, NaiveDate, NaiveDateTime, NaiveTime};.

What am I missing? Does chrono work with stdweb or only wasm-bindgen?

@kristoff3r
Copy link

I had the same issue until I realized that the feature is called wasmbind, which imports both wasm-bindgen and js-sys. That plus default-features = false made it work for me with stdweb and wasm-bindgen.

I got a bit tricked by issue #382, which is apparently a bit out of date.

@quodlibetor
Copy link
Contributor

I'm going to close this because I'm pretty sure kristoff3r's comment is correct. Feel free to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants