Skip to content

Unable to compile to WASM with sentry_flutter due to incompatibilities with device_info_plus. #2399

@Fraa-124

Description

@Fraa-124

Platform

Flutter Web

Obfuscation

Enabled

Debug Info

Enabled

Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 3.27.0-0.1.pre, on macOS 14.6.1 23G93 darwin-arm64, locale en-ES)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.95.2)
[✓] VS Code (version 1.86.1)

Version

8.9.0

Steps to Reproduce

Related issue can be found here fluttercommunity/plus_plugins#3254

flutter build web --wasm -t lib/main.dart

Expected Result

To compile to WASM, ensure you’re using the latest version of device_info_plus.

Actual Result

In my app, I’ve discovered that when I exclude the following Sentry initialization code, the application successfully compiles to WebAssembly (WASM). However, including this code results in compilation issues, indicating a possible incompatibility with WASM.

await SentryFlutter.init((options) {
          options.dsn = '...';
          options.environment = config.env.toJson();
          options.sampleRate = 1;
          options.dist = buildNumber;
          options.release = 'app@${config.version ?? 'dev'}';
        }, appRunner: () async { 
   ...
});

Are you willing to submit a PR?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions