Questions tagged [wasm-pack]
78
questions
0
votes
0
answers
36
views
Npm cannot find an executable while running the create-wasm-app JavaScript project template
I have been following a Rust + WebAssembly Tutorial and on the 2nd part of the 2nd chapter, after looking into the files and telling you how to build them, the tutorial asks you to run this command: ...
2
votes
1
answer
47
views
How to compile a wasm via rust to access the Global Val?
Currently, I am working on a project which uses the wasmtime (a wasm runtime implemented by rust) to load and initiate some wasm modules.
And I would like a wasm module to access the global val. So I ...
0
votes
1
answer
45
views
Does WASM Bindgen copy &mut [u8] zero times or twice?
From JavaScript, I call this Rust function. Does Bindgen copy the memory twice or zero times?
#[wasm_bindgen]
pub fn mod_u8_slice(input_output: &mut [u8]) {
input_output.iter_mut().for_each(|x|...
2
votes
0
answers
32
views
After 'cargo install wasm-pack' do I need to manually update chrome & chromedriver?
I'm on Windows 11. When I cargo install wasm-pack it installs chromedriver v 114, but v 114 doesn't work with the current version of Chrome.
I want to be able to run tests via wasm-pack test --chrome -...
0
votes
0
answers
24
views
How to pass parameters to the chromedriver when running Rust tests
I'm trying to reproduce an example of Rust-application by following the step-by-step instructions. Everything was going fine before the start of testing. I stopped at the last line of this page.
Only ...
1
vote
1
answer
67
views
Compiling rust with webback for webassembly
The error occurs when i use opencascade = "0.2.0" dependency.
following is my Cargo.toml
[package]
name = "wasm-demo"
version = "0.1.0"
authors = ["Ravi"]
...
0
votes
0
answers
55
views
'Uncaught TypeError: Cannot read properties of undefined (reading 'length')' in wasm-pack generated code
(For a better formatted message without a giant blob of code, I'd recommend seeing the GitHub issue.)
Error message
Uncaught TypeError: Cannot read properties of undefined (reading 'length') in https:/...
0
votes
1
answer
45
views
problem in window().set_timeout_with_callback_and_timeout_and_arguments_0 , how to setTimeout in rust-wasm correctly?
I am building a snake game in web assembly, after lot of code commenting and un-commenting, i am seeing where it is giving me error, its giving me error in window()....
0
votes
1
answer
123
views
Why does an error appear on compiling time v0.3.34 when installing wasm-pack?
Running
cargo install wasm-pack
I get many green lines of "Compiling" and then the following
Compiling time v0.3.34
error[E0602]: unknown lint: `invalid_reference_casting`
|
= note: ...
0
votes
0
answers
38
views
Memory allocation in Javascript when consuming a serialized value from Rust
Using prost I build this serialized type for my SecretKey
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default, rename_all = "camelCase")]
#[allow(clippy::...
2
votes
1
answer
3k
views
Can tokio::runtime be used in wasm?
everybody.
let rt = tokio::runtime::Runtime::new().unwrap();
This code doesn't work when I try to build wasm.
let rt = tokio::runtime::Runtime::new().unwrap();
| ^^^^^^...
-1
votes
1
answer
498
views
Unable to build wasm-pack project - `wasm-opt` download failed
wasm-pack is unable to download the required tools for optimizing wasm-opt.
This fails the build. I'm left with only option of disabling wasm optimizations with wasm-opt = false.
$ wasm-pack build
...
5
votes
3
answers
1k
views
How to get a value out of a wasm_bindgen_futures::spawn_local
I know that wasm doesn't have blocking so how would I do the equivalent. Or is there a different tool to use? I'm new to this so it could also be that my approach is completely off. I'm using wasm-...
0
votes
1
answer
66
views
rust wasm-pack build warning: private type `World` in public interface (error E0446)
i have this code and i dont understand why is this warrning is poping:
use wasm_bindgen::prelude::*;
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[wasm_bindgen]...
1
vote
1
answer
247
views
can't make new project with wasm-pack new myProjectName
ewmacfarland@Erics-MacBook-Air wasm-crypto % wasm-pack new crypto
Error: expected value at line 1 column 1
Caused by: expected value at line 1 column 1
tried un and reinstalling it every way i could
...