sentry-rust
sentry-rust copied to clipboard
Fails on compile time for WASM target.
Environment
Latest rust, latest bevy, sentry 0.27.0.
Steps to Reproduce
Use this template and build for Wasm using trunk serve
Add with default dependencies:
sentry = { version = "0.27.0" }
Run trunk serve and notice that during compile time it's giving an error exactly like this one.
Expected Result
I would expect sentry package to work out of the box when using default features.
The package hostname will not be solving the issue because they prefer it that way. (see this comment from the owner).
So in order for that to happen, the hostname package should probably become an optional dependency which is not applied for WASM builds.
Actual Result
We have to customise features like so (I did not end up even getting it to work at all)
sentry = { version = "0.27.0", default-features = false, features = [
"backtrace",
# "contexts", # Will not work for WASM target
"panic",
# "transport", # no `Proxy` in the root
] }
- Enabling contexts, will give said error
- Keeping
transportdisabled will panic during runtime:

- Enabling transport will give the following errors:

Any advice on how to get this working?
I don't think this will be working anytime soon. Apart of the dependencies that do not support WASM target, all types should be ?Send since WASM is a single threaded environment.
Seems like a duplicate of https://github.com/getsentry/sentry-rust/issues/226
I wish we could get this working, or at least have a very clear guide on how to integrate with a build based on wasmpack.