I'm following these docs: https://github.com/RustAudio/cpal/wiki/Setting-up-a-new-CPAL-WASM-project
I added this to my Cargo.toml
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so it's only enabled
# in debug mode.
[target."cfg(debug_assertions)".dependencies]
console_error_panic_hook = "0.1.5"
But it gives this warning:
warning: Found `debug_assertions` in `target.'cfg(...)'.dependencies`. This value is not supported for selecting dependencies and will not work as expected. To learn more visit https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies
Sadly, that doc says "There is currently no way to add dependencies based on these configuration values."
I think a feature needs to be used instead.