weareseeed / react-square-web-payments-sdk

Easily create PCI-compliant inputs to accept payments online with the Square Payments API. It supports the following payment methods: credit and debit cards, ACH bank transfers, Apple Pay, Google Pay, Gift Cards and Afterpay/Clearpay.
https://react-square-payments.weareseeed.com/
MIT License
38 stars 41 forks source link

'react-square-web-payments-sdk' does not contain a default export (imported as 'SquarePaymentsForm') #27

Closed v1ra1 closed 2 years ago

v1ra1 commented 2 years ago

What version of React are you using?

17.02

What version of Node.js are you using?

16.13.0

What browser are you using?

97

What operating system are you using?

Windows 10

How are you deploying your application?

yarn start

Describe the Bug

import SquarePaymentsForm, { CreditCardInput } from 'react-square-web-payments-sdk';

Using:

`<SquarePaymentsForm /**

In a component.

Result:

Attempted import error: 'react-square-web-payments-sdk' does not contain a default export (imported as 'SquarePaymentsForm').

Expected Behavior

It to load the square form or have a default export?

To Reproduce

Just load it in on a standard react project.

v1ra1 commented 2 years ago

import { CreditCardInput, SquarePaymentsForm } from 'react-square-web-payments-sdk';

This is what fixed it.

mallen13 commented 2 years ago

I tried the mentioned solution to resolve, with the copied and pasted code into my react project, but still get an error.

Attempted import error: 'payments' is not exported from '@square/web-sdk' (imported as '$6CgYg$payments').

yousafnawaz commented 2 years ago

I tried the mentioned solution to resolve, with the copied and pasted code into my react project, but still get an error.

Attempted import error: 'payments' is not exported from '@square/web-sdk' (imported as '$6CgYg$payments').

I am facing the same issue, anyone knows how to resolve this?

danestves commented 2 years ago

We will be looking into this issue, but please create a new one with that error

cc @gabrielelpidio