sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

Fails on compile time for WASM target.

Open webbertakken opened this issue 2 years ago • 2 comments

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 transport disabled will panic during runtime:

image

  • Enabling transport will give the following errors:

image

Any advice on how to get this working?

webbertakken avatar Nov 05 '22 22:11 webbertakken

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.

omarabid avatar Nov 07 '22 03:11 omarabid

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.

hut8 avatar Dec 05 '22 21:12 hut8