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

Sentry dart plugin does not detect and send .dart files to Sentry. #283

Closed
lukaszmielczarekdev opened this issue Nov 21, 2024 · 17 comments · Fixed by #285
Closed

Sentry dart plugin does not detect and send .dart files to Sentry. #283

lukaszmielczarekdev opened this issue Nov 21, 2024 · 17 comments · Fixed by #285

Comments

@lukaszmielczarekdev
Copy link

Environment

Sentry dart plugin v.2.2.0

Steps to Reproduce

The problem I have is that it doesn't send .dart files to Sentry, it only sends one package with .js files (10 pieces). There should be a second portion, much larger with .dart files. The logs say that it found 10 files first, then 0. In the previous version of the package, all files were sent, and in the latest one only one part.

Image

Expected Result

Image

Actual Result

Image

@buenaflor buenaflor moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Nov 21, 2024
@buenaflor
Copy link
Contributor

thx for the info, with 2.1.0 it worked before?

@lukaszmielczarekdev
Copy link
Author

Yeah. The expected result screenshot is from version 2.1.0.

@buenaflor
Copy link
Contributor

buenaflor commented Nov 21, 2024

We bumped our default Sentry CLI version from v2.27.0 to v2.38.1 in 2.2.0, could you try setting sentry_cli_version to 2.27.0 in your plugin config and see if that makes a difference?

If not then we'd have to take a look at this pr

@lukaszmielczarekdev
Copy link
Author

Still doesn't work.
I have a Flutter app that is embedded in a React app when built.
I use fvm flutter build web --base-href "/simulator/" --source-maps --output "../shopify/web/frontend/simulator" --dart-define=SENTRY_RELEASE="${RELEASE_NAME}" --dart-define=SENTRY_DIST="${DIST_ID}".
Maybe this information will be useful.

@lukaszmielczarekdev
Copy link
Author

UPDATE: I changed the build_path to a few folders up and now the .dart files are uploaded and working 😉

@vaind
Copy link
Collaborator

vaind commented Nov 27, 2024

@lukaszmielczarekdev could you post your updated config? I'd like to understand what's going on (I've made the PR to change what we upload)

And also what these configured directories contain (a screenshot of the dir/file structure would be enough) if it's OK

@martinhaintz martinhaintz removed their assignment Nov 27, 2024
@ciprig
Copy link

ciprig commented Nov 28, 2024

In 2.1.0 the web_build_path was a full path build/web and now in 2.2.0 is relatively just web making existing configurations invalid. We have changed to use the defaults and still, sentry reports that there is nothing to upload for web builds

INFO 2024-11-28 11:39:49.497905769 +00:00 sentry-cli was invoked with the following command line: "/builds/web/flutter/.dart_tool/pub/bin/sentry_dart_plugin/sentry-cli" "--auth-token" "[REDACTED]" "--log-level" "info" "releases" "--org" "xxx" "--project" "flutter" "files" "[email protected]+9132" "upload-sourcemaps" "build/web" "--ext" "map" "--ext" "js" "--dist" "9132" "--wait"

Rewriting sources
Adding source map references
Nothing to upload

this is the config

sentry:
upload_debug_symbols: true
upload_source_maps: true
upload_sources: true
project: flutter
org: xxx
auth_token: [xxx]
wait_for_processing: true
log_level: debug
commits: auto
ignore_missing: false

@vaind
Copy link
Collaborator

vaind commented Nov 28, 2024

@lukaszmielczarekdev @ciprig this issue should be fixed by #285

You can verify or use the fix in the meantime by adding a dependency override:

  sentry_dart_plugin:
    git:
      url: https://github.com/getsentry/sentry-dart-plugin.git
      ref: efa59dda844c34c6399bc09ae9fa27f0fd9daa27

@github-project-automation github-project-automation bot moved this from Needs Investigation to Done in Mobile & Cross Platform SDK Nov 29, 2024
@buenaflor
Copy link
Contributor

official fix is released in 2.2.1

@bizz84
Copy link

bizz84 commented Jan 14, 2025

I'm still running into this issue. My setup:

dev_dependencies:
  sentry_dart_plugin: ^2.2.1

# Sentry Dart Plugin
sentry:
  upload_debug_symbols: true
  upload_source_maps: false
  upload_sources: false
  project: flutter-tips-app
  org: andrea-bizzotto
  wait_for_processing: true
  log_level: error # possible values: trace, debug, info, warn, error
  commits: auto
  ignore_missing: true
  symbols_path: build

Run commands:

flutter build web -t lib/main_prod.dart --dart-define=WEB_FLAVOR=prod --dart-define-from-file=.env.prod --base-href / --release --source-maps

dart run sentry_dart_plugin --sentry-define=upload_source_maps=true --sentry-define=upload_sources=true

Report:

Source Map Upload Report
  Scripts
    ~/assets/packages/mixpanel_flutter/assets/mixpanel.js (sourcemap at ../../../../main.dart.js.map)
    ~/canvaskit/canvaskit.js (sourcemap at ../main.dart.js.map)
    ~/canvaskit/chromium/canvaskit.js (sourcemap at ../../main.dart.js.map)
    ~/canvaskit/skwasm.js (sourcemap at ../main.dart.js.map)
    ~/canvaskit/skwasm.worker.js (sourcemap at ../main.dart.js.map)
    ~/drift_worker.js (sourcemap at main.dart.js.map)
    ~/flutter.js (sourcemap at flutter.js.map)
    ~/flutter_bootstrap.js (sourcemap at flutter.js.map)
    ~/flutter_service_worker.js (sourcemap at main.dart.js.map)
    ~/main.dart.js (sourcemap at main.dart.js.map)
  Source Maps
    ~/main.dart.js.map

> Found 86 files

> Analyzing 86 sources

> Rewriting sources

> Adding source map references

> Bundled 86 files for upload
> Bundle ID: 70e520bb-70e7-5d33-ba70-f5795bf1ccbb

> Uploaded files to Sentry

> File processing complete
> Organization: andrea-bizzotto
> Project: flutter-tips-app
> Release: [email protected]+57
> Dist: 57
> Upload type: artifact bundle

Source Map Upload Report
  Scripts
    ~/app_routes.dart (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/app_routes.dart)
    ~/firebase_options_dev.dart (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/firebase_options_dev.dart)

~/firebase_options_prod.dart (no sourcemap ref)
      - warning: could not determine a source map reference (Could not auto-detect referenced sourcemap for ~/firebase_options_prod.dart)
... and so on

Any ideas what could be wrong?

@buenaflor
Copy link
Contributor

cc @denrase could you have a look here pls

@buenaflor
Copy link
Contributor

@bizz84 hey andrea, I've looked at your project and it looks fine as far as I can see, also the dart files have been uploaded, can you send me a link to a sample where the source context is not shown? [email protected]

@otopba
Copy link

otopba commented Feb 13, 2025

I have same issue

@buenaflor
Copy link
Contributor

@otopba which plugin version are you using?

@otopba
Copy link

otopba commented Feb 13, 2025

@otopba which plugin version are you using?

sentry_dart_plugin: ^2.4.0

@buenaflor
Copy link
Contributor

@otopba could you create another issue please with steps to reproduce, and the platforms it affects etc..

@otopba
Copy link

otopba commented Feb 14, 2025

@otopba could you create another issue please with steps to reproduce, and the platforms it affects etc..

Sure. Done #302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants