P
P
PaveDUrov2018-03-22 17:43:59
PayPal
PaveDUrov, 2018-03-22 17:43:59

How to fix 'paypal-checkout' typing error for typescript?

Good day, when typing the paypal-checkout plugin, the following error occurs:

[Vue warn]: Error in mounted hook: "TypeError: __WEBPACK_IMPORTED_MODULE_1_paypal_checkout___default.a is not a constructor"

please tell me what I'm doing wrong here is my declare module
declare module "paypal-checkout" {
  const paypal: {
    new(): Paypal;
  };
  export = paypal;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PaveDUrov, 2018-03-22
@PaveDUrov

Solved the problem
instead of the class made a namespace

declare let paypal: any;
declare module "paypal-checkout" {
  export = paypal;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question