I would like to have better stacktrace information when I get some error information over sentry. At the moment, flutter sentry only gives you a stacktrace where it appears as "Compiled" code and it makes debugging more difficult.
Is there a way to upload the source maps or the source code to have a more accurate idea when an error comes ?
thank you!
Here an example (It is not really useful) :
there is a new flag you can set when building https://github.com/flutter/flutter/issues/72150
--source-maps
the following script might help you
export SENTRY_RELEASE=$(date +%Y-%m-%d_%H-%M-%S)
export OUTPUT_FOLDER_WEB=./build/web/
flutter build web --dart-define=SENTRY_RELEASE=$SENTRY_RELEASE --source-maps
echo -e "[\033[92mrun\033[0m] Uploading sourcemaps for $SENTRY_RELEASE"
sentry-cli releases new $SENTRY_RELEASE
sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps . \
--ext dart \
--rewrite
sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps ${OUTPUT_FOLDER_WEB}main.dart.js.map
sentry-cli releases finalize $SENTRY_RELEASE

Sentry also provides an example without the --source-maps https://github.com/getsentry/sentry-flutter/blob/d22e8376648dd9746304646036dbd24bb885e177/example/run.sh#L24-L29
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With