Hello developer, I’m currently building an integration of React Square Web Payments SDK with NextJS. I am getting build error below. Don’t able to understand why am getting this error in nextjs. Kindly help me here.
Dependency packages:
Error: require() of ES Module D:\nft-nxtjs\NFT-NEXT\node_modules@square\web-sdk\dist\index.js from D:\nft-nxtjs\NFT-NEXT\node_modules\react-square-web-payments-sdk\dist\rswps.cjs.js not supported. Instead change the require of index.js in D:\nft-nxtjs\NFT-NEXT\node_modules\react-square-web-payments-sdk\dist\rswps.cjs.js to a dynamic import() which is available in all CommonJS modules.