-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to instantiate logger due to error message which originates from wasm-bindgen #3447
Comments
FWIW this can be shortened with
There's really very little info to go by here. But I'm going to assume that the issue here is the compile target. It would be really helpful to put up a minimal reproducible example. |
Here's the minimal reproducible example |
You seem to be compiling with By the way, the |
Okay, so I was trying to remove wasm-bindgen from my project, but it refused to do it. It turns out that the console-log crate depends on wasm-bindgen. I'm going to reimplement the logger from scratch because I need proper logging to work and I can't use wasm32-unknown-unknown due to other dependencies banning using unknown target OS and requiring specifying using an "OS" even if it's emscripten. I would like to reopen this issue as a feature request to start supporting emscripten |
Unfortunately that's not possible, as The deeper problem here is that Unfortunately there is currently no solution for this, though the Rust team is aware of it and is trying to find a solution: rustwasm/team#291. One proposal that might solve that problem is a new Wasm ABI: rust-lang/rust#83788. Though it is currently still unstable. So as it stands today, |
Thanks! I dropped wasm-bindgen as I wasn't using it myself, it was just a dependency of one of my dependencies. I've successfully implemented my own logger by using Emscripten's EM_ASM. This requires writing both very basic C and continuing Rust as usual, but it at least works. |
Summary
When running
console_log::init().unwrap();
from the below code, I get the error message:function not implemented on non-wasm32 targets
on Firefox.Additional Details
The build script is really complicated right now. I currently call SDL_main as I have not been able to get any indication of the code running in console if I attached the wasm_bindgen macro at all.
I'm using:
I'm calling my wasm file with the below code after I generate both the js and wasm file with emmc:
My project is located at https://github.com/alexisart/catgirl-engine
The text was updated successfully, but these errors were encountered: