Riya Soni
Riya Soni

Reputation: 197

Integrating Stripe payment in React js

I have implemented taking payments using Stripe in my demo React project and as a back end I am using Express Js.

Now, I am trying to merge that demo project code inside my actual project but it shows an error while running it as shown below:

CheckoutForm.js?8185:16 Uncaught ReferenceError: 
    regeneratorRuntime is not defined 

So I Googled this error and added the following dependencies to my package.json file but still I am facing the above error.

"babel-core": "^6.26.3", 
"babel-polyfill": "^6.26.0",  
"babel-preset-es2015": "^6.24.1", 
"babel-preset-stage-0": "^6.24.1

Below is my .babelrc file code.

{
  "stage"   : 0,
  "env": {
    "development": {
      "plugins" : ["react-transform"],
      "extra": {
        "react-transform": [{
          "target" : "react-transform-hmr",
          "imports" : ["react"],
          "locals" : ["module"]
        }, {
          "target" : "react-transform-catch-errors",
          "imports" : ["react", "redbox-react"]
        }]
      }
    },
    "production": {

    }
  }
}

Would anyone have any reference link or solution to this problem?

Upvotes: 4

Views: 666

Answers (1)

GoGoCarl
GoGoCarl

Reputation: 2517

I actually ran into this yesterday with a different library. What worked for me was to do what you did above, but also import the polyfill in the main entry point component of my App:

import 'babel-polyfill';

That's probably what you're missing.

Upvotes: 5

Related Questions