#mindegg_reactnative-web
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1259901236212138086
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
This is my custom provider pay button that has stripe logic.
Can you be more specific? What doesn't work? What errors are you getting?
In the parent component I wrapped it like this but it's still causing issues with my web build.
{Platform.OS != 'web' && (
<StripeProvider
publishableKey=""
urlScheme='exp://192.168.12.94:8081/--/'
merchantIdentifier="merchant.com.patshala"
setReturnUrlSchemeOnAndroid={true}>
<ProviderPayButton
userId={userId}
orderId={orderId}
amount={openPrice ? openPrice : totalAmount}
objectId={""}
currency={AmountCurrencyEnum.Usd}
transactionType={TransactionType.Purchase}
buttonText={"Checkout"}
allowsDelayedPaymentMethods={true}
onPaymentSuccess={() => {
console.log("Payment successful!");
setModalVisible(false)
}}
/>
</StripeProvider>
)}
This is the error I am getting: Unable to resolve "../../Utilities/Platform" from "node_modules/react-native/Libraries/Components/TextInput/TextInputState.js"
A little background, I am using stripe on my expo react native app. I am building an ios, android and web app with the same code base. The Stripe React Native SDK works on ios and android but not the web app. I can't even add an if clause to it and only enable it in the mobile apps without breaking the web app.
This is the error I am getting Unable to resolve "../../Utilities/Platform" from "node_modules/react-native/Libraries/Components/TextInput/TextInputState.js"
This question was asked before and someone was looking into a fix for this. #891017548949250179 message
@robust light I don't think we support a web build with ReactNative. Also the error doesn't seem to be with Stripe right? Seems closer to https://github.com/expo/web-examples/issues/73 for example
But really our ReactNative SDK is for iOS and Android, not web
mindegg_reactnative-web
But this only appears when I uncomment my stripe button.
it's possible that our SDK is incompatible with your web build, likely because this isn't a platform we support. Also our Expo support is limited, they pin to a really old version of our own SDK too
And the previous person, Bob had the same issue and it's documented here too. https://github.com/stripe/stripe-react-native/issues/917
How am I supposed to use Stripe on my mobile app and my web app. Even when when I use a conditional statement where it's just supposed to work on mobile app, it crashes my web.
Here is my code
{Platform.OS != 'web' && (
<StripeProvider
publishableKey=""
urlScheme='exp://192.168.12.94:8081/--/'
merchantIdentifier="merchant.com.patshala"
setReturnUrlSchemeOnAndroid={true}>
<ProviderPayButton
userId={userId}
orderId={orderId}
amount={openPrice ? openPrice : totalAmount}
objectId={""}
currency={AmountCurrencyEnum.Usd}
transactionType={TransactionType.Purchase}
buttonText={"Checkout"}
allowsDelayedPaymentMethods={true}
onPaymentSuccess={() => {
console.log("Payment successful!");
setModalVisible(false)
}}
/>
</StripeProvider>
)}
I don't know sorry. You'll need to have different version of your apps/codebase. One for mobile and one for web without the SDK
What do you mean by this? Which version should I have this is what I have. "@stripe/react-stripe-js": "^2.7.2",
"@stripe/stripe-js": "^4.0.0",
"@stripe/stripe-react-native": "^0.37.3",
But I am not even at the point where I am putting anything for web. Even with the conditional statement it's breaking my web build.
You need to make it so that "@stripe/stripe-react-native": "^0.37.3", is not included in your web build
See this condition, it's still breaking my web build. {Platform.OS != 'web' && (
<StripeProvider
publishableKey=""
urlScheme='exp://192.168.12.94:8081/--/'
merchantIdentifier="merchant.com.patshala"
setReturnUrlSchemeOnAndroid={true}>
<ProviderPayButton
userId={userId}
orderId={orderId}
amount={openPrice ? openPrice : totalAmount}
objectId={""}
currency={AmountCurrencyEnum.Usd}
transactionType={TransactionType.Purchase}
buttonText={"Checkout"}
allowsDelayedPaymentMethods={true}
onPaymentSuccess={() => {
console.log("Payment successful!");
setModalVisible(false)
}}
/>
</StripeProvider>
)}
Oh I see, how do I do that?
you likely need to do something like this where you only have the dependency for iOS or Android.
I don't know more sorry, this is something you'll need to figure out as it's more a ReactNative/Expo question and not really specific to Stripe
It's very Stripe related
and it's a huge deal breaker when using stripe
It's documented in previous questions here and in the actual github discussions page
I only get this error and can remove it when I comment out stripe code
@robust light sorry I think you're too focused on "this doesn't work". I did explain what to do now. You need to figure out how to make our ReactNative SDK and the related code only be built on iOS and Android targets and not web.
I don't know exactly how to do this, I'm sorry. You're the developer here, now that I explained the issue, you need to look for an answer for example online like the example I gave you above.
It is likely common when building a ReactNative mobile app to have parts of the code that are iOS or Android or web specific so it's what you need to focus on now.
That's okay but it's breaking my web build. Even if I don't include stripe payments in my web app, and just my mobile app it's breaking my web app.