stripe-react-native
stripe-react-native copied to clipboard
INVALID_PLUGIN_IMPORT on EAS build
Describe the bug
I get this error when creating a build via Expo EAS. I am on the newest version of Expo (53.0.7) and @stripe/stripe-react-native (0.45.0). I have installed the library as indicated in the docs https://github.com/stripe/stripe-react-native?tab=readme-ov-file#expo
PluginError: Package "@stripe/stripe-react-native" does not contain a valid
config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin
Cannot use import statement outside a module
Code: INVALID_PLUGIN_IMPORT
I'm having this same issue. We upgraded React Native/Expo to the newest versions and now Stripe is broken.
Dev Build Error
Package "@stripe/stripe-react-native" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin
Unexpected token 'typeof'
Error: build command failed.
Here's our set up:
Dependencies in package.json:
"expo": "53.0.7",
"react": "19.0.0",
"react-native": "0.79.2",
"@stripe/stripe-react-native": "^0.45.0",
App Config:
[
'@stripe/stripe-react-native',
{
urlScheme: '<my-app>://',
merchantIdentifier: 'merchant.com.<my-app>',
enableGooglePay: false,
},
],
App.js Stripe Wrapper
<StripeProvider
publishableKey={<PK>}
merchantIdentifier="merchant.com.<my-app>"
urlScheme="<my-app>://"
>
/* ... code... */
</StripeProvider>
Hello, I could use some more information to debug further:
- This happens when building for which platform?
- What version of node are you using?
- Does this happens only on EAS or can you reproduce the issue locally too?
same issue
Bump!
Bump as well :-)
Getting same
Having the same issue
I also encountered this same issue when creating an iOS build. I think the problem seems to be a syntax issue within the config plugin, likely due to untranspiled typescript.
As a temporary hotfix, I created a local, pure JavaScript copy of the plugin (/plugins/withFixedStripe.js) and updated my app.json to reference it directly
{
"expo": {
"plugins": [
["./plugins/withFixedStripe.js", {
"merchantIdentifier": "merchant.com.example",
"enableGooglePay": true
}]
]
}
}
This workaround allows the app to build successfully, and both Apple Pay and Google Pay works correctly. It's not a permanent solution, but it works until it's fixed.
Have the same issue locally. Reinstalling packages and running rebuild does not fix it.
This seems to work for Expo:
// app.json
{
"expo": {
...
[
"@stripe/stripe-react-native/app.plugin.js",
{
"merchantIdentifier": "merchant.com.example",
"enableGooglePay": true
}
],
}
}