Uncaught (in promise) LinkError: import object field '__wbg_error_09919627ac0992f5' is not a Function + JsValue(undefined) instead of objects #4029
Replies: 7 comments
-
https://github.com/nshen/vite-plugin-wasm-pack this partially solved it |
Beta Was this translation helpful? Give feedback.
-
now the problem is that despite me passing an object into a function, what goes into wasm is read as |
Beta Was this translation helpful? Give feedback.
-
yeah so I've triple checked it with console.log(myInput) // {a: 1, b: 2}
myWasmPackage.handle_my_input(myInput) and in rust it's #[wasm_bindgen(skip_typescript)]
pub fn handle_my_input(my_data: JsValue) -> JsResult<JsValue> {
console_log!(
"handle_my_input :: {:#?}",
my_data
);
// ...
} and it prints
|
Beta Was this translation helpful? Give feedback.
-
https://github.com/Niedzwiedzw/vite-wasm-pack-error-showcase here's a repository showcasing this problem |
Beta Was this translation helpful? Give feedback.
-
I'm attempting to reproduce it but encountered an error building your Rust code: Could you please test it using my plugin https://www.npmjs.com/package/vite-plugin-wasm and the |
Beta Was this translation helpful? Give feedback.
-
I ran into this Q4 2023 but was unable to figure out the cause, and because of that I quit using tinysearch. I opened the issue here: tinysearch/tinysearch#175 I setup a reproducible test case repo for this here: https://github.com/Jieiku/abridge-tinysearch-dev The readme in that test case repo has instructions for reproducing this error, I am stumped as to what to do next because I have almost zero rust experience. If you follow the steps in the readme from the test case repo, here is the result you see in the firefox developer console: If you do not want to use zola serve, you can alternatively use zola build and upload the files from the public directory to your web server of choice. |
Beta Was this translation helpful? Give feedback.
-
Should I have opened a new issue? This still happens to me and I see this was moved to discussion. |
Beta Was this translation helpful? Give feedback.
-
that happens when I import a package generated by wasm-pack
Beta Was this translation helpful? Give feedback.
All reactions