get undefined is not an object when trying to stripe.init - react-native

I am trying to use tipsi-stripe and when calling stripe.init I am getting the following error
Code
import stripe from 'tipsi-stripe'
stripe.init({
publishableKey: 'key',
// merchantId: 'merchant_id', // Optional
})
Error

I have seen this error before when I forgot to link native modules. It seems like you have not linked a native module.
Make sure you do
react-native link tipsi-stripe
or
rnpm link

Related

WalletConnectProvider from react-native-dapp not working

I am trying to implement a functionality in my react-native app where in I can connect my app with metamask or any other non-custodial wallet app. The library I am using for this is https://www.npmjs.com/package/#walletconnect/react-native-dapp.
The following is the code snippet:
<WalletConnectProvider
redirectUrl={Platform.OS === 'web' ? window.location.origin : 'yourappscheme://'}
storageOptions= {{
asyncStorage AsyncStorage,
}}>
<>{/* awesome app here */}</>
</WalletConnectProvider>
However, when I try to run the app, it shows the following errors:
TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[0], "./providers").WalletConnectProvider')
Error: Requiring module "node_modules\#walletconnect\react-native-dapp\dist\providers\index.js", which threw an exception: TypeError: Object prototype may only be an Object or null.
Any idea why this issue?
I was facing the issues due to the use of npx rn-nodeify --install --hack.
Tried using "node-libs-react-native" inside the devDependencies as suggested at
https://github.com/WalletConnect/walletconnect-monorepo/issues/753

Console Warning in React Native

I'm with my react native app and when I run it I get the following error:
Failed prop type: Invalid prop `source` supplied to `Image`, expected one of type[number].
In the react.development.js file:
Function.prototype.apply.call(console[level], console, argsWithFormat);
^
Please provide the source code where the Image component is used.
Double-check the syntax towards the docs: https://reactnative.dev/docs/image

trying to use tipsi-twitter in snack.expo.io?

I'm trying to use tipsi-twitter in snack.expo.io but I'm running into issues. I added the following item into package.json dependencies:
"tipsi-twitter": "*"
Expo then appeared to successfully install this package. In my App.js I included the following import:
import TwitterAuth from 'tipsi-twitter';
The import compiles successfully but when I put the following code after the imports:
TwitterAuth.init({
twitter_key: '<TWITTER_KEY>',
twitter_secret: '<TWITTER_SECRET>',
})
This returns an error of:
"Cannot read property 'init' of undefined"
But this appears to be the exact implementation in the Usage section of the tipsi-twitter github page:
https://github.com/tipsi/tipsi-twitter#usage
Any idea what the issue might be or how to debug? Am I possibly missing some type of configuration step or is it possible that expo.io doesn't support this package/scenario?

Cannot read property 'CheckFrequency' of undefined

My team recently added CodePush to our React Native app, and while it works perfectly fine on the original local repository, when I pull the changes I get the error
Cannot read property 'CheckFrequency' of undefined
This occurs after installing react-native-code-push and linking it properly. All answers I found for similar questions seemed to have this error when using Jest, but we are not using Jest and this error happens any time I run react-native run-ios
The code looks like this:
CodePush is imported
import codePush from "react-native-code-push";
And later in the same file, the error occurs on
let codePushOptions = {
checkFrequency: codePush.CheckFrequency.MANUAL, // error here
updateDialog: false,
installMode: codePush.InstallMode.IMMEDIATE
}
Try changing import to
import * as CodePush from 'react-native-code-push';
In my case that was because I didn't link the package properly.
once you link "react-native-codepush" properly (either automatic or using rnpm or manually) codePush won't be undefined.

Undefined is not an object (evaluating '_react.PropTypes.number'

I have such error in React Native project,
Undefined is not an object (evaluating '_react.PropTypes.number'
I have new import of PropTypes in all project. Any ideas how to solve this issue?
React.PropTypes has been moved from react package to prop-types package, you're probably using an outdated third party component that havn't made the necessary updates.
Edit : if this error is from your PropTypes declaration you have to use PropTypes.number instead of React.PropTypes.number