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
37 stars 40 forks source link

Module parse failed: Unexpected token #81

Closed v1ra1 closed 1 year ago

v1ra1 commented 1 year ago

Describe the bug

`./node_modules/react-square-web-payments-sdk/dist/components/divider/divider.es.js 10:13 Module parse failed: Unexpected token (10:13) File was processed with these loaders:

Your Example Website or App

test.com

Steps to Reproduce the Bug or Issue

I moved from "react-square-web-payments-sdk": "^2.2.3" to "react-square-web-payments-sdk": "^3.2.1"

Upon doing a yarn start I get the following error after converting everything specified

https://react-square-payments.weareseeed.com/docs/migrating-from-v2-to-v3

Here is my package.json

{ "name": "example", "version": "0.1.0", "private": true, "dependencies": { "@bugsnag/js": "^7.16.2", "@bugsnag/plugin-react": "^7.16.4", "@date-io/moment": "^2.11.0", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@mui/icons-material": "^5.5.1", "@mui/material": "^5.0.0", "@mui/styled-engine-sc": "^5.0.0", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "axios": "^0.19.2", "babel-plugin-import": "^1.13.5", "connected-react-router": "^6.6.1", "customize-cra": "^0.9.1", "date-fns": "^2.24.0", "eslint": "^6.8.0", "eslint-config-react-app": "^5.2.0", "eslint-plugin-cypress": "^2.9.0", "eslint-plugin-flowtype": "3", "eslint-plugin-import": "^2.20.1", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.18.3", "eslint-plugin-react-hooks": "1", "global": "^4.4.0", "globalize": "^0.1.1", "history": "^4.10.1", "jwt-decode": "^2.2.0", "less": "^3.10.3", "less-loader": "^5.0.0", "moment": "^2.29.1", "prop-types": "^15.7.2", "react": "^18.2.0", "react-acceptjs": "^0.2.0", "react-app-rewired": "^2.1.8", "react-authorize-net": "^0.5.7", "react-device-detect": "^2.2.2", "react-dom": "^18.2.0", "react-images-uploading": "^3.1.3", "react-intl-redux": "^2.2.0", "react-medium-image-zoom": "^4.3.5", "react-quill": "^1.3.3", "react-redux": "^7.1.3", "react-router": "^5.1.2", "react-router-dom": "^5.1.2", "react-scripts": "^4.0.0", "react-square-web-payments-sdk": "^3.2.0", "redux": "^4.0.5", "redux-persist": "^6.0.0", "redux-saga": "^1.1.3", "styled-components": "^5.3.1", "styled-normalize": "^8.0.6", "sweetalert2": "^11.2.1", "tsconfig-paths-webpack-plugin": "^3.5.1", "tsdx": "^0.14.1", "tslib": "^2.3.1", "web-vitals": "^1.0.1" }, "scripts": { "start": "react-app-rewired --max-old-space-size=4096 start", "build": "react-app-rewired --max-old-space-size=4096 build", "test": "react-app-rewired --max-old-space-size=4096 test", "eject": "react-scripts eject", }, "devDependencies": { "@mui/lab": "^5.0.0-alpha.47", "eslint-config-prettier": "8.3.0", "eslint-plugin-prettier": "3.4.0", "gulp": "4.0.2", "gulp-append-prepend": "1.0.9", "prettier": "^1.19.1", "start-server-and-test": "^1.10.8" }, "optionalDependencies": { "@babel/runtime": "7.13.8", "typescript": "4.2.4" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }

Expected behavior

I would assume it working would be the expected behavior

Screenshots or Videos

image

Platform

Additional context

No response

v1ra1 commented 1 year ago

For anyone that runs into this. I updated the following:

1- "@testing-library/jest-dom"

2- "@testing-library/react"

3- "@testing-library/user-event"

4- "web-vitals"

And then installed:

yarn add @babel/plugin-syntax-import-assertions

yarn install