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

fix(ios): Warn and do not overwrite when iOS build uses outdated source maps configuration #3775

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog

## Unreleased

### Fixes

- Warn and do not overwrite when `$EXTRA_PACKAGER_ARGS` with `--sourcemap-output` detected during iOS build ([#3775](https://github.com/getsentry/sentry-react-native/pull/3775))
- Only when using `sentry-xcode.sh`, learn how to use it at https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#configure-automatic-source-maps-upload

## 5.22.0

### Features
Expand Down
18 changes: 17 additions & 1 deletion scripts/sentry-xcode.sh
Expand Up @@ -10,13 +10,29 @@ set -x -e
LOCAL_NODE_BINARY=${NODE_BINARY:-node}

[ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"

[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))")
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="${SENTRY_CLI_PACKAGE_PATH}/bin/sentry-cli"

REACT_NATIVE_XCODE=$1

if [[ "$EXTRA_PACKAGER_ARGS" == *"--sourcemap-output"* ]]; then
echo "*****************************************************************************************" >&2
echo "*****************************************************************************************" >&2
echo "***** WARNING *****" >&2
echo "*****************************************************************************************" >&2
echo "*****************************************************************************************" >&2
echo "" >&2
echo "Using \$EXTRA_PACKAGER_ARG variable with \`--sourcemap-output\` will cause" >&2
echo "unpredictable behaviour with Hermes, use \$SOURCEMAP_FILE instead." >&2
echo "" >&2
echo "See https://reactnative.dev/docs/0.74/debugging-release-builds#enabling-source-maps" >&2
echo "" >&2
echo "*****************************************************************************************" >&2
else
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"
fi

[[ "$AUTO_RELEASE" == false ]] && [[ -z "$BUNDLE_COMMAND" || "$BUNDLE_COMMAND" != "ram-bundle" ]] && NO_AUTO_RELEASE="--no-auto-release"
ARGS="$NO_AUTO_RELEASE $SENTRY_CLI_EXTRA_ARGS $SENTRY_CLI_RN_XCODE_EXTRA_ARGS"

Expand Down