rustwasm / console_error_panic_hook

A panic hook for wasm32-unknown-unknown that logs panics with console.error
Apache License 2.0
326 stars 24 forks source link

Error when used with `cargo web` #8

Closed estk closed 6 years ago

estk commented 6 years ago

As soon as I start my app I get the following in the console and a broken app:

Uncaught (in promise) TypeError: Import #5 module="__wbindgen_placeholder__" error: module is not an object or function
fitzgen commented 6 years ago

Thanks for filing an issue.

This crate depends on wasm-bindgen and using the wasm-bindgen CLI to post-process the wasm binary to generate bindings and all that. Running the CLI will remove the place holder imports. You can use wasm-pack to orchestrate this process.

I'm unsure if the stdweb/cargo web/yew will conflict with running wasm-bindgen CLI or not.