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
Pass a Rust closure into the JavaScript world that takes a String (haven't tested &str) and invoke the Rust closure with a JavaScript object (e.g. {}).
You will get a very annoying error that doesn't describe what you did at all: [Error] RuntimeError: Unreachable code should not be executed (evaluating 'realloc(ptr, len, len = offset + arg.length * 3)') This is not a bug, however the error message can be improved
Steps to Reproduce
From Rust side, put a closure into the 'global' or window scope:
An error should occur, since the Rust closure was invoked with the wrong arguments.
I would like a clear and concise error message of what wasm-bindgen expected to happen compared to what did happen.
Maybe an error message like Did you call a Rust closure with invalid arguments? instead of RuntimeError: Unreachable code should not be executed (evaluating 'realloc(ptr, len, len = offset + arg.length * 3)'
Actual Behaviour
This error message was logged using the console_error_panic_hook crate running on Safari (using leptos to insert JS script, and calling from a JS firebase callback fn), although my error seems generic (but I haven't tested it on other platforms).
Describe the Bug
Pass a Rust closure into the JavaScript world that takes a
String
(haven't tested&str
) and invoke the Rust closure with a JavaScript object (e.g.{}
).You will get a very annoying error that doesn't describe what you did at all:
[Error] RuntimeError: Unreachable code should not be executed (evaluating 'realloc(ptr, len, len = offset + arg.length * 3)')
This is not a bug, however the error message can be improved
Steps to Reproduce
From Rust side, put a closure into the 'global' or
window
scope:Then register it:
From the JS side, load a script into the HTML and execute it, calling
window._func
with a JS Object (not the expectedString
):Expected Behavior
An error should occur, since the Rust closure was invoked with the wrong arguments.
I would like a clear and concise error message of what
wasm-bindgen
expected to happen compared to what did happen.Maybe an error message like
Did you call a Rust closure with invalid arguments?
instead ofRuntimeError: Unreachable code should not be executed (evaluating 'realloc(ptr, len, len = offset + arg.length * 3)'
Actual Behaviour
This error message was logged using the
console_error_panic_hook
crate running on Safari (usingleptos
to insert JS script, and calling from a JSfirebase
callback fn), although my error seems generic (but I haven't tested it on other platforms).This error also happened (full stack omitted):
Additional Context
Using Safari, happy to add any more details upon request
The text was updated successfully, but these errors were encountered: