Sentry-react-native: Cannot read property 'match' of undefined

Created on 7 Jun 2018  ·  3Comments  ·  Source: getsentry/sentry-react-native

Hi, I had an issue with react-native link:

rnpm-install info Linking react-native-sentry ios dependency 
rnpm-install ERR! Something went wrong while linking. Error: Cannot read property 'match' of undefined 
Please file an issue here: https://github.com/facebook/react-native/issues 

Cannot read property 'match' of undefined

I have managed to link by changing:

script.shellScript = JSON.stringify(JSON.parse(script.shellScript)
                // "legacy" location for this.  This is what happens if users followed
                // the old documentation for where to add the bundle command
                .replace(/^..\/node_modules\/react-native-sentry\/bin\/bundle-frameworks\s*?\r\n?/m, '')
                // legacy location for dsym upload
                .replace(/^..\/node_modules\/@sentry\/cli\/bin\/sentry-cli upload-dsym\s*?\r?\n/m, '')
                // remove sentry properties export
                .replace(/^export SENTRY_PROPERTIES=sentry.properties\r?\n/m, '')
                // unwrap react-native-xcode.sh command.  In case someone replaced it
                // entirely with the sentry-cli command we need to put the original
                // version back in.
                .replace(/^(?:..\/node_modules\/@sentry\/cli\/bin\/)?sentry-cli\s+react-native[\s-]xcode(\s+.*?)$/m, function (match, m1) {
                var rv = m1.trim();
                if (rv === '') {
                    // return '../node_modules/react-native/packager/react-native-xcode.sh'; // Actual
                    return '../node_modules/react-native/scripts/react-native-xcode.sh'; // Change
                }
                else {
                    return rv;
                }
            }));

My project properties:
react 16.3.1
react-native 0.55.2

Edit: Changed in file node_modules/@sentry/wizard/dist/lib/Steps/Integrations/ReactNative.js

🦔react-native-sentry

Most helpful comment

Add the following line in the Pod file
#Add new pods below this line

All 3 comments

Add the following line in the Pod file
#Add new pods below this line

@krishnadas89 lol that worked for me! 😂
What the hell is this React Native.. omg

And that line is not even used in the docs: 🤦‍♂️
https://facebook.github.io/react-native/docs/integration-with-existing-apps#configuring-cocoapods-dependencies

FYI It worked when linking another RN module to a RN v0.56 app

I am closing all old issues, please if this is still a problem feel free to revive it.
Also, consider moving to our new SDK @sentry/react-native if it still happens there please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings