Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Maps does not works with Flutter Web #38

Closed
ghost opened this issue Aug 29, 2022 · 19 comments
Closed

Source Maps does not works with Flutter Web #38

ghost opened this issue Aug 29, 2022 · 19 comments
Labels
Platform: Dart question Further information is requested

Comments

@ghost
Copy link

ghost commented Aug 29, 2022

Environment

Flutter SDK version

"flutterSdkVersion": "3.0.5"

sentry_dart_plugin version:

sentry_dart_plugin: ^1.0.0-beta.1

stdout: > Found 3631 release files
> Analyzing 3631 sources
> Rewriting sources
> Adding source map references
> Bundled 3631 files for upload
> Uploaded release files to Sentry
> File upload complete (processing pending on server)
> Organization: novade
> Project: novade
> Release: novade_lite@1.7.0+63
> Dist: 63

Steps to Reproduce

  1. Build the project for web.
  2. Setup pubspec config as following
sentry:
  upload_source_maps: true
  1. Run flutter flutter packages pub run sentry_dart_plugin

Expected Result

We were using sentry-cli to upload source map previously and it also didn't work. We were asked to try this new plugin and seem it also doesn't work.

Screenshot 2022-08-29 at 3 41 22 PM

Actual Result

Source maps should setup correctly.

@marandaneto
Copy link
Contributor

@chathu-novade The screenshot is about the source maps of the Dart SDK itself and not your App's code.
Do you see your App's code symbolicated? that should work OOTB.

@marandaneto marandaneto added the question Further information is requested label Aug 30, 2022
@ghost
Copy link
Author

ghost commented Aug 30, 2022

This is what the stack looks like. Can not see the anything related to app code.
Screenshot 2022-08-30 at 1 16 48 PM

@ghost
Copy link
Author

ghost commented Aug 30, 2022

The hidden source section of the screenshot looks like the following.

source: https://domain.tld/hostedtoolcache/Flutter/3.0.5/macos/flutter/.pub-cache/hosted/pub.dartlang.org/sentry-6.9.1/lib/src/sentry_client.dart

@marandaneto
Copy link
Contributor

I don't follow, the screenshot below has the symbolicated stack trace, it's not minified, what's the problem you are having? can you please update the issue description with more details?

@ghost
Copy link
Author

ghost commented Aug 30, 2022

@marandaneto I can not see any stack trace related my my dart code in the flutter project. It show only minified:e4b and exception but not the line of dart code.

@marandaneto
Copy link
Contributor

marandaneto commented Aug 30, 2022

@chathu-novade can you provide the code snippet of the Sentry SDK init?
Can you provide the full config of the sentry plugin?
Can you provide the command line you are using to build your Flutter app?
Can you provide a link to an issue on sentry.io so I can have a look?

@ghost
Copy link
Author

ghost commented Aug 30, 2022

Sentry SDK init

 await SentryFlutter.init(
      (options) {
        options
          ..environment = env.toStr()
          ..release = sentryRelease // from String.fromEnvironment('SENTRY_RELEASE')
          ..dsn = dsn;
      },
      // Init your App.
      appRunner: () => runApp(const _App()),
    );

Sentry plugin config

sentry:
  upload_source_maps: true

Flutter build command

flutter build web --dart-define=SENTRY_RELEASE=$(SENTRY_RELEASE) --dart-define=AMPLITUDE_API_KEY=$(AMPLITUDE_API_KEY) -t lib/web/main.staging.dart --web-renderer canvaskit --source-maps --dart-define=BROWSER_IMAGE_DECODING_ENABLED=false

@ghost ghost changed the title Source Maps does works with Flutter Web Source Maps does not works with Flutter Web Aug 30, 2022
@marandaneto
Copy link
Contributor

@chathu-novade release and dist should match when initing the SDK and uploading source maps.
I see that you don't set the dist at least, do they match?
Can you provide a link to an Sentry's issue?

@marandaneto
Copy link
Contributor

@chathu-novade you probably need --release in your build command line as well.

@ghost
Copy link
Author

ghost commented Aug 30, 2022

dist is default so it get build in build/web which also the default of this plugin.

@ghost
Copy link
Author

ghost commented Aug 30, 2022

@marandaneto

https:
//sentry.io/organizations/novade/issues/
3543519896/
?project=1770595

@ghost
Copy link
Author

ghost commented Aug 30, 2022

The flutter mobile builds works well Issue is with the web build

@marandaneto
Copy link
Contributor

@chathu-novade I don't see any problem with your errors, its symbolicated correctly.
The issue title is minified:e2b because of https://docs.sentry.io/platforms/flutter/troubleshooting/#known-limitations
See runtimeType.
You are likely calling captureException with an object that is not an exception and its stringified, so there's no problem with symbolication.
Can you clarify the problem?

@ghost
Copy link
Author

ghost commented Aug 30, 2022

@chathu-novade you probably need --release in your build command line as well.

--release Build a release version of your app (default mode).

@ghost
Copy link
Author

ghost commented Aug 30, 2022

@marandaneto In that error there are errors which says source code not found.

Screenshot 2022-08-30 at 8 00 48 PM

@marandaneto
Copy link
Contributor

@chathu-novade that's already answered here #38 (comment)
If you don't see any frame from your own App, the reason is here #38 (comment)
So I guess that's all from my side unless you provide more context around my questions.

@ghost
Copy link
Author

ghost commented Sep 1, 2022

About

The issue title is minified:e2b because of https://docs.sentry.io/platforms/flutter/troubleshooting/#known-limitations
See runtimeType.

Does this applicable to the web too?

web
Obfuscation is not supported for web apps, but a web app can be minified, which is similar. When you build a release version of a Flutter web app, it is automatically minified. For more information, see Build and release a web app.

@marandaneto
Copy link
Contributor

Please raise an issue on https://github.com/getsentry/sentry-dart and provide a minimal reproducible example (this is required), it's unclear what's the problem here since the linked event just works, without more context, we can't help.

@ghost
Copy link
Author

ghost commented Sep 1, 2022

https 
://sentry.io/organizations/novade/issues/ 
3510915187/events/ 
bcaba367a7e74e92b0f7258900827d9a/

Check this issue and expand the stackstrace. We can not see which file threw the exception and not usable stack trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Dart question Further information is requested
Projects
Archived in project
Development

No branches or pull requests

1 participant