checkout-sdk-node icon indicating copy to clipboard operation
checkout-sdk-node copied to clipboard

response.header.raw not a function (Vuejs. Webpack issue)

Open Dewald928 opened this issue 2 years ago • 0 comments

I've tried running the basic request:

const cko = new Checkout('sk_test...');
const payment = await cko.payments.get("pay_w6ktefehnck2zlguyvocdvuhry");

But this gave me:

API Error: API Error
    at eval (webpack-internal:///./node_modules/checkout-sdk-node/dist/services/errors.js:289:18)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (webpack-internal:///./node_modules/checkout-sdk-node/dist/services/errors.js:8:103)
    at _next (webpack-internal:///./node_modules/checkout-sdk-node/dist/services/errors.js:10:194)

with an error body of: "response.header.raw not a function"

My current setup

Quasar + Vuejs I also tried this on Nuxt.js. Got the same issue.


I also tried running it plainly as a simple nodejs script. That worked. But as soon as it runs in a vuejs framework it seems to break. And I suspect it might be some webpack nonsense with node-fetch perhaps.

Thanks!

Dewald928 avatar May 20 '22 11:05 Dewald928