-
Notifications
You must be signed in to change notification settings - Fork 269
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
Expo Web Server Error None of these files exist: node_modules/react-native/Libraries/Utilities/Platform(...) #1802
Comments
I am having the same issue but when trying to create a web build with npx expo export -p web |
didn't work |
@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: const { getDefaultConfig } = require('expo/metro-config');
const { withNativeWind } = require('nativewind/metro');
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);
const platformSpecific = process.env.PLATFORM === 'web' ? {
resolver: {
...config.resolver,
blacklistRE: /\.native\.[jt]sx?$/
}
} : {};
const updatedConfig = {
...config,
...platformSpecific
};
module.exports = withNativeWind(updatedConfig, { input: './global.css' }); Then I specify the platform, when building, using: 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. Hope this helps!! |
I had the same issue but I resolved it checking the component import. In my case I was importing instead of
|
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: