Replies: 2 comments
-
It's hard to say what exactly the issue is without seeing how you're instantiating the wasm module on the JS side, as well as where you're running the JS, etc. If you're doing the same thing as the Stack Overflow question you linked, using |
Beta Was this translation helpful? Give feedback.
-
You are right, the Stack Overflow code is wrong and I didn't notice it. I am using the JS wrapper. The setup here is pretty complex. Let me clean it a little bit and I link it with a proper description in a few days. Thank you for the help. |
Beta Was this translation helpful? Give feedback.
-
Describe the Bug
Hi, I've got such a code:
When compiling it with
wasm-pack --target=web
and calling it from JS, I've gotundefined
as a result. It seems that I'm not the only one facing this issue and it seems that compiling everything with--target=nodejs
makes it working: https://stackoverflow.com/questions/70079979/how-do-i-return-a-string-from-a-rust-function-in-nodejs-webassembly-using-wasm-bI'm not sure whether this issue is connected more with wasm-pack or wasm-bindgen, but as wam-pack is not very actively maintained, I prefer to ask here first for any help / guidance. Thank you :)
Beta Was this translation helpful? Give feedback.
All reactions