question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

undefined is not a function (evaluating stripe module.init(options)

See original GitHub issue

The problem

When I try to set up Stripe for my app, I’m getting the following error: undefined is not a function (evaluating stripe module.init(options)

I believe it is a linking issue, but when I try to run react-native link tipsi-stripe, I get a SPAWN UNKNOWN error. I am developing this app on Expo but running it on an Android device, so I followed the instructions here https://tipsi.github.io/tipsi-stripe/docs/linking.html for manually linking for Android. I’m using a Windows computer and so don’t have Xcode.

Also, I’ve read that you need to detach the project from Expo in order to utilize Apple Pay, but at this point we are just trying to do payments through cards and would love to not have to detach. If it is not possible to use tipsi-stripe with Expo without having to detach, I’d love to hear any alternatives!

Please let me know if you want any more information about the issue!

Environment

  • tipsi-stripe version: 5.4.0
  • Last tipsi-stripe version where the issue was not reproduced (if applicable):
  • iOS or Android: Android
  • OS version: Windows 10
  • React-Native version: 0.55.4
  • (Android only) com.google.firebase:firebase-core version:
  • (Android only) com.google.android.gms:play-services-base version:

For Android, please provide the following sections from android/app/build.gradle:

  • android.compileSdkVersion: 23
  • android.buildToolsVersion: 23.0.1
  • android.defaultConfig.minSdkVersion: 16
  • android.defaultConfig.targetSdkVersion: 22
  • android.defaultConfig.multiDexEnabled (if exists)

Screenshots, GIFs

screenshot_20180803-103404_expo

Code To Reproduce Issue

stripe.setOptions({ publishableKey: ‘pk_test_7Hatfb7bdJuKHTHwdusk2R1L’, androidPayMode: ‘test’, });

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
shamankingcommented, Aug 7, 2018

I have same issue with IOS

0reactions
LivanDiazcommented, Sep 12, 2020

@MRHuezo Hi … I was having the same problem … what I did was create a little new project where I only use (expo-payments-stripe) … Once you create the project, run it with Xcode until it compiles successfully and runs in the simulator. (In the version of Xcode that I am using, it only runs correctly in the iphone 8 simulator in the others it gives me problems) … then from a code editor install (expo-payments-stripe) and follow the steps in the documentation of Expo.io or help from the (tipsi-stripe (automatic)). then you stop the compilation in Xcode and run it again … it should work for you … that problem is due to the link of the modules that it seems that only Xcode is capable of doing it in the case of IOS. Try it and let me know if it worked for you. note: it only works for me if I run it from Xcode … if it works differently for someone … let me know …

Read more comments on GitHub >

github_iconTop Results From Across the Web

get undefined is not an object when trying to stripe.init
I have seen this error before when I forgot to link native modules. It seems like you have not linked a native module....
Read more >
null is not an object( evaluating StripeModule.init) Tipsi-Stripe
i have an asynchronous function that retrieves a token from stripe to authenticate the purchase. then it makes an axios call to post...
Read more >
Stripe API reference – Node
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries....
Read more >
Stripemodule Failing For Android React Native Project
this type of projects linked automatically and didn't have any android or ios directory for undefined is not an object (evaluating 'StripeModule.init') on ......
Read more >
TypeError: cannot use 'in' operator to search for 'x' in 'y'
Make sure the object you are inspecting isn't actually null or undefined . const foo = null; "bar" in foo; // TypeError: cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found