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
Using a parameter with the type &str results in the compiler not complaining and building completely fine. As soon as the function is called on the Javascript side, a huge error log is being printed from which it is hard to tell what the actual issue is.
The following code shows a minimal example of the issue:
// lib.rs
use node_bindgen::derive::node_bindgen;
#[node_bindgen]
fn hi(name: &str) {
println!("Hello {}", name);
}
// main.js
let addon = require("../dist");
addon.hi("Hello");
Running the main.js file results in the following error log:
It took me many hours to figure out where the problem was. I guess it would make sense to point to this error during the build to avoid other users getting stuck on this kind of error.
The text was updated successfully, but these errors were encountered:
Hi,
we recently started using
node-bindgen
in our project https://github.com/esrlabs/chipmunk and noticed the following:Using a parameter with the type
&str
results in the compiler not complaining and building completely fine. As soon as the function is called on the Javascript side, a huge error log is being printed from which it is hard to tell what the actual issue is.The following code shows a minimal example of the issue:
Running the
main.js
file results in the following error log:It took me many hours to figure out where the problem was. I guess it would make sense to point to this error during the build to avoid other users getting stuck on this kind of error.
The text was updated successfully, but these errors were encountered: