Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(expo): Add concrete error messages for RN bundle build phase patch #3626

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- Add concrete error messages for RN bundle build phase patch ([#3626](https://github.com/getsentry/sentry-react-native/pull/3626))

### Fixes

- Option `enabled: false` ensures no events are sent ([#3606](https://github.com/getsentry/sentry-react-native/pull/3606))
Expand Down
27 changes: 21 additions & 6 deletions plugin/src/withSentryIOS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,29 @@ export const withSentryIOS: ConfigPlugin<string> = (config, sentryProperties: st
};

export function modifyExistingXcodeBuildScript(script: BuildPhase): void {
if (
!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/) ||
script.shellScript.includes('sentry-xcode.sh') ||
script.shellScript.includes('@sentry')
) {
if (!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/)) {
WarningAggregator.addWarningIOS(
SDK_PACKAGE_NAME,
"Unable to modify build script 'Bundle React Native code and images'. Please open a bug report at https://github.com/expo/sentry-expo.",
`'react-native-xcode.sh' not found in 'Bundle React Native code and images'.
Please open a bug report at https://github.com/getsentry/sentry-react-native`,
);
return;
}

if (script.shellScript.includes('sentry-xcode.sh')) {
WarningAggregator.addWarningIOS(
SDK_PACKAGE_NAME,
"The latest 'sentry-xcode.sh' script already exists in 'Bundle React Native code and images'.",
);
return;
}

if (script.shellScript.includes('@sentry')) {
WarningAggregator.addWarningIOS(
SDK_PACKAGE_NAME,
`Outdated or custom Sentry script found in 'Bundle React Native code and images'.
Regenerate the native project to use the latest script.
Run npx expo prebuild --clean`,
);
return;
}
Expand Down
Loading