madonoharu / tsify

A library for generating TypeScript definitions from rust code.
Apache License 2.0
300 stars 41 forks source link

No method named `to_string` found for struct with `from_wasm_abi` #56

Open wjthieme opened 1 month ago

wjthieme commented 1 month ago
no method named `to_string` found for struct `serde_wasm_bindgen::error::Error` in the current scope
items from traits can only be used if the trait is in scope

Example of working code

#[derive(Serialize, Deserialize, Tsify)]
#[serde(rename_all = "camelCase")]
#[tsify(into_wasm_abi)]
pub struct Foo {
  pub value: u128
}

Example of non-working code

#[derive(Serialize, Deserialize, Tsify)]
#[serde(rename_all = "camelCase")]
#[tsify(into_wasm_abi, from_wasm_abi)]
pub struct Foo {
  pub value: u128
}
wjthieme commented 3 weeks ago

Looks like the issue is no_std. Any way to get this working without std?