Stack traces not showing correctly in IOS production build
OS:
- [ ] Windows
- [x] macOS
- [ ] Linux
Platform:
- [x] iOS
- [ ] Android
SDK:
- [x]
@sentry/react-native(^5.20.0) - [ ]
react-native-sentry(<= 0.43.2)
SDK version: RNSentry (5.20.0)
react-native version: 0.70.14
Are you using Expo?
- [ ] Yes
- [x] No
Are you using sentry.io or on-premise?
- [x] sentry.io (SaaS)
- [ ] on-premise
If you are using sentry.io, please post a link to your issue so we can take a look:
Configuration:
I have the following issue:
We've just updated @sentry/react-native from 3.1.1 to 5.20.0. And, after following the documentation and troubleshooting guide, our iOS production stack traces weren’t pointing the error correctly.
We found that the problem was the debug files upload script modifications. We use the sentry-cli upload-dsymcommand, but the docs: says "Note, that upload-dsym has been replaced by debug-files upload and requires a path".
Our code was:
#!/bin/sh
export NODE_BINARY=node
if [[ "${SENTRY_ENABLED}" == "true" ]]; then
echo "Uploading debug symbols to sentry"
export SENTRY_PROPERTIES=sentry.properties
../../node_modules/@sentry/cli/bin/sentry-cli upload-dsym
fi
and we updated to:
#!/bin/sh
export NODE_BINARY=node
if [[ "${SENTRY_ENABLED}" == "true" ]]; then
echo "Uploading debug symbols to sentry"
export SENTRY_PROPERTIES=sentry.properties
../../node_modules/@sentry/cli/bin/sentry-cli debug-files upload "$DWARF_DSYM_FOLDER_PATH"
fi
--
Furthermore, we've also updated the source maps build step, as pointed in the documentation, but it also didn’t work. Our code was:
#!/bin/sh
set -e
export WITH_ENVIRONMENT="../../node_modules/react-native/scripts/xcode/with-environment.sh"
export REACT_NATIVE_XCODE="../../node_modules/react-native/scripts/react-native-xcode.sh"
export PROJECT_ROOT=..
export SENTRY_PROPERTIES=sentry.properties
export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
export SENTRY_CLI_PATH="../../node_modules/@sentry/cli/bin/sentry-cli"
if [[ "${SENTRY_ENABLED}" == "true" ]]; then
echo "Sentry integration is enabled"
$WITH_ENVIRONMENT "$SENTRY_CLI_PATH react-native xcode $REACT_NATIVE_XCODE"
else
$WITH_ENVIRONMENT $REACT_NATIVE_XCODE
fi
and we updated it to:
#!/bin/sh
set -e
export WITH_ENVIRONMENT="../../node_modules/react-native/scripts/xcode/with-environment.sh"
export REACT_NATIVE_XCODE="../../node_modules/react-native/scripts/react-native-xcode.sh"
export SENTRY_XCODE="../../node_modules/@sentry/react-native/scripts/sentry-xcode.sh"
export BUNDLE_REACT_NATIVE="/bin/sh $SENTRY_XCODE $REACT_NATIVE_XCODE"
export PROJECT_ROOT=..
export SENTRY_PROPERTIES=sentry.properties
export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
export SENTRY_CLI_PATH="../../node_modules/@sentry/cli/bin/sentry-cli"
if [[ "${SENTRY_ENABLED}" == "true" ]]; then
echo "Sentry integration is enabled"
/bin/sh -c "$WITH_ENVIRONMENT \"$BUNDLE_REACT_NATIVE\" $SENTRY_CLI_PATH"
else
$WITH_ENVIRONMENT $REACT_NATIVE_XCODE
fi
--
After some investigation, we've found out that even with the sentry update, the unmodified scripts still worked correctly, and the stack traces were showing up as expected. We decided to continue the update without these “updated scripts” to comply with the apple privacy manifest update.
So, we have two main questions here:
- Is there any missing configuration needed in the updated code snippets?
- Will the
upload-dsymcommand be depreciated anytime soon? The docs and changelog points to the depreciation, but it seems to still work as expected.
Steps to reproduce:
Actual result:
Expected result: