Android - Cannot read property 'StripeProvider' of undefined

Open
#2,000 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react-native, typescript
Domain
mobile, payments

Research direction

Start by reproducing the crash in a new React Native 0.80.1 Android project using @stripe/stripe-react-native ^0.49.0. Inspect how StripeProvider is imported and how the package is initialized or linked on Android. Done means StripeProvider renders without the undefined-property error on emulators and real devices.

Written by the indexing model from the issue text.

Description

Describe the bug
When trying to import and use the StripeProvider from the @stripe/stripe-react-native package, the app crashes with the error:
Cannot read property 'StripeProvider' of undefined.
This suggests that the package is either not linked correctly or not properly initialized.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new React Native project (e.g., using npx react-native init).
  2. Install @stripe/stripe-react-native.
  3. Import StripeProvider from @stripe/stripe-react-native.
  4. Use component in your app.
  5. Run the app.
  6. See the error in the console or app crash.

Expected behavior
The component should be properly imported and usable without causing runtime errors.

Desktop (please complete the following information):

  • OS: [macos sequoia 15.5]
  • Node version: [20.15.0]
  • React Native version: [0.80.1]
  • Stripe React Native version: [^0.49.0]

Smartphone (please complete the following information):

  • Device: [Emulators and real devices]
  • OS: [Android]

Additional context

  • The package is installed via npm.
  • Tried cleaning build cache, reinstalling node_modules, and rebuilding the app.
  • The error occurs immediately upon rendering the component.
Dominant language
TypeScript
Stars
1.4k
Forks
328
Avg merge
3d 9h
Merged PRs (30d)
23

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stripe/stripe-react-native

All issues in stripe/stripe-react-native

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.