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
When creating a function that accepts a vector of exported rust structs in rust > 1.82 on big enough sizes function returns an error.
Steps to Reproduce
Use hello_world example and set wasm_bindgen to version 2.99.
Create a function and a struct in rust:
#[wasm_bindgen]#[derive(Clone,Copy,Debug)]pubstructPartialTestData{puba:u32,pubb:f64,pubc:f64,}#[wasm_bindgen]implPartialTestData{#[wasm_bindgen(constructor)]pubfnnew(a:u32,b:f64,c:f64) -> Self{returnSelf{ a, b, c };}}#[wasm_bindgen]pubfntest_sum(param:Vec<PartialTestData>) -> u64{letmut k = 0u64;for v in param {
k += u64::from(v.a)}return k;}
An exception in console TypeError: attempting to access detached ArrayBuffer in Firefox or TypeError: Cannot perform DataView.prototype.setUint32 on a detached ArrayBuffer in Chrome
Additional Context
The issue doesn't happen in versions of rust below 1.82. I also didn't test options other than bundler.
The text was updated successfully, but these errors were encountered:
Note: the bug is specific to the reference type transformations. So it doesn't show up in 0.2.92 because reference type transformations were not enabled by default back then.
Describe the Bug
When creating a function that accepts a vector of exported rust structs in rust > 1.82 on big enough sizes function returns an error.
Steps to Reproduce
npm install
,npm run serve
Expected Behavior
Alert with a result of a computation.
Actual Behavior
An exception in console
TypeError: attempting to access detached ArrayBuffer
in Firefox orTypeError: Cannot perform DataView.prototype.setUint32 on a detached ArrayBuffer
in ChromeAdditional Context
The issue doesn't happen in versions of rust below 1.82. I also didn't test options other than bundler.
The text was updated successfully, but these errors were encountered: