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
Unfortunately, after the 0.8.1 update the crate doesn't compile anymore in wasm (because the instant crate in fact doesn't).
Compiling instant v0.1.12
error[E0433]: failed to resolve: use of undeclared crate or module wasm_bindgen
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:172:17
|
172 | let v = js! { return Date.now(); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module wasm_bindgen
|
= note: this error originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared crate or module wasm_bindgen
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:124:13
|
124 | let v = js! { return performance.now(); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module wasm_bindgen
|
= note: this error originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type WasmDescribe
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:124:13
|
124 | let v = js! { return performance.now(); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type WasmDescribe
|
= note: this error originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type WasmDescribe
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:172:17
|
172 | let v = js! { return Date.now(); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type WasmDescribe
|
= note: this error originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find function inform in this scope
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:124:13
|
124 | let v = js! { return performance.now(); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
= note: this error originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value FUNCTION in this scope
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:124:13
|
124 | let v = js! { return performance.now(); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
= note: this error originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find function inform in this scope
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:172:17
|
172 | let v = js! { return Date.now(); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
= note: this error originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value FUNCTION in this scope
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:172:17
|
172 | let v = js! { return Date.now(); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
= note: this error originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no method named try_into found for enum Value in the current scope
--> /home/stymaar/.cargo/registry/src/github.com-1ecc6299db9ec823/instant-0.1.12/src/wasm.rs:173:18
|
173 | return v.try_into().unwrap();
| ^^^^^^^^ method not found in Value
|
= help: items from traits can only be used if the trait is in scope
= note: 'std::convert::TryInto' is included in the prelude starting in Edition 2021
help: the following traits are implemented but not in scope; perhaps add a use for one of them:
|
1 | use crate::stdweb::unstable::TryInto;
|
1 | use std::convert::TryInto;
|
Some errors have detailed explanations: E0425, E0433, E0599.
For more information about an error, try rustc --explain E0425.
Easy step to reproduce:
wasm-pack new bug_measure_time
cd bug-measure-time/
cargo add measure_time
wasm-pack build --target web
The text was updated successfully, but these errors were encountered:
Thanks for the easy reproduction steps. I used the stdweb feature-flag, which seems to use performance.now. It's unclear why this is not available with wasm-pack build --target web, every browser that supports wasm will have performance.now.
It works when I use the wasm-bindgen feature flag. The docs don't really say what's the difference between the two.
Unfortunately, after the 0.8.1 update the crate doesn't compile anymore in wasm (because the
instant
crate in fact doesn't).Easy step to reproduce:
wasm-pack new bug_measure_time cd bug-measure-time/ cargo add measure_time wasm-pack build --target web
The text was updated successfully, but these errors were encountered: