You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional Context
My project uses Expo Router, and the entry point is as follows:
<Viewstyle={styles.container}>{/* Logo */}<Animated.Viewstyle={[styles.logoContainer,{opacity: fadeAnim}]}><Imagesource={require('...')}style={styles.logo}resizeMode='contain'/></Animated.View>{/* Onboarding Screens */}{isFirstLaunch&&<OnboardingComponentfadeValue={onboardingFade}/>}</View>
The app is not wrapped with <StripeProvider> at the root due to Expo Router's limitations. Instead, specific pages are wrapped where needed, which works for mobile builds.
Question
Is this a bug in @stripe/stripe-react-native, or am I missing a configuration for Expo Web?
The text was updated successfully, but these errors were encountered:
@OmerKayaa I actually solved this. The issue stems from @stripe/stripe-react-native as it is not compatible with web. I ended up creating separate components for native and web e.g TipCheckout.native.tsx and TipCheckout.web.tsx.
One using @stripe/stripe-react-native (.native.tsx) and one using embedded stripe checkout (.web.tsx)
Then I modified my metro.config.js to ignore .native files when building for web:
Then I specify the platform, when building, using: PLATFORM=web npx expo export -p web
Personally I had no issue before doing this when running npm start for local development. I only had the issue when bundling for web, specifically when deploying with Vercel.
The key takeaway here is @stripe/stripe-react-native cannot be present in web builds.
Describe the bug
When adding the following line to my code:
or
the web server (and only the web server) throws the following error:
This issue occurs only in the web environment (Expo web). Mobile builds work as expected.
To Reproduce
Steps to reproduce the behavior:
npx expo start
.http://localhost:8081
).Expected Behavior
The web server should serve the website without throwing an error.
Screenshots
Environment
Other Dependencies
Key dependencies:
The full package.json
Additional Context
My project uses Expo Router, and the entry point is as follows:
The app is not wrapped with
<StripeProvider>
at the root due to Expo Router's limitations. Instead, specific pages are wrapped where needed, which works for mobile builds.Question
Is this a bug in
@stripe/stripe-react-native
, or am I missing a configuration for Expo Web?The text was updated successfully, but these errors were encountered: