-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Missing Instructions for iOS Source Map Upload in React Native Migration Guide (5.x to 6.x) #11829
Comments
Assigning to @getsentry/support for routing ⏲️ |
Hi @mbellagamba, Could you also share the state of the "Bundle React Native code and images" before the upgrade. |
On production build, the app crashed on startup. When I debugged it the error is something like "main.jsbundle does not exist".
My previous version of the shell script "Bundle React Native code and images" is what I've read on the previous version of Sentry Docs. set -e
export SENTRY_PROPERTIES=sentry.properties
export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
WITH_ENVIRONMENT="$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
REACT_NATIVE_XCODE="$REACT_NATIVE_PATH/scripts/react-native-xcode.sh"
SENTRY_CLI_PATH="../node_modules/@sentry/cli/bin/sentry-cli"
/bin/sh -c "$WITH_ENVIRONMENT "$SENTRY_CLI_PATH react-native xcode "/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode.sh $REACT_NATIVE_XCODE\"" In particular this update fixed by build. -shellScript = "set -e\nexport SENTRY_PROPERTIES=sentry.properties\nexport EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map\"\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\nSENTRY_CLI_PATH=\"../node_modules/@sentry/cli/bin/sentry-cli\"\n/bin/sh -c \"$WITH_ENVIRONMENT \\\"$SENTRY_CLI_PATH react-native xcode \\\"/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode.sh $REACT_NATIVE_XCODE\\\"\\\"\"\n";
+shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\nSENTRY_XCODE=\"../node_modules/@sentry/react-native/scripts/sentry-xcode.sh\"\nBUNDLE_REACT_NATIVE=\"/bin/sh $SENTRY_XCODE $REACT_NATIVE_XCODE\"\n/bin/sh -c \"$WITH_ENVIRONMENT \\\"$BUNDLE_REACT_NATIVE\\\"\"\n"; I don't know too much what's happening here, but it seems like the Thanks for your work! |
Thank you @mbellagamba, I have formated the before and after scripts and I've discovered that the before script was incorrect regardless the SDK version. I'm not sure how that happened. set -e
-export SENTRY_PROPERTIES=sentry.properties
-export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
-WITH_ENVIRONMENT="$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
-REACT_NATIVE_XCODE="$REACT_NATIVE_PATH/scripts/react-native-xcode.sh"
+WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
+REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
-SENTRY_CLI_PATH="../node_modules/@sentry/cli/bin/sentry-cli"
-/bin/sh -c "$WITH_ENVIRONMENT \"$SENTRY_CLI_PATH react-native xcode \"/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode.sh $REACT_NATIVE_XCODE\"\""
+SENTRY_XCODE="../node_modules/@sentry/react-native/scripts/sentry-xcode.sh"
+BUNDLE_REACT_NATIVE="/bin/sh $SENTRY_XCODE $REACT_NATIVE_XCODE"
+/bin/sh -c "$WITH_ENVIRONMENT \"$BUNDLE_REACT_NATIVE\"" Specifically the following part.
|
SDK
React Native SDK
Description
The current migration guide for upgrading Sentry in React Native projects from version 5.x to 6.x lacks instructions for updating the iOS project configuration related to source map uploads. This omission results in an incomplete migration guide and may lead to broken Release builds for iOS.
The migration guide does not mention the need to update the "Bundle React Native code and images" build phase in the iOS project file to configure automatic source map uploads. This step is critical and is documented in the Manual Configuration section of the Sentry documentation.
Without these changes: debug builds in the iOS simulator function correctly, masking the problem but release archives crash on startup because the JS bundle is not correctly generated.
Suggested Solution
Update the React Native migration guide for version 5.x to 6.x to include clear steps for modifying the "Bundle React Native code and images" build phase, ensuring the necessary changes are included during migration.
The text was updated successfully, but these errors were encountered: