magiclabs / magic-js

Magic browser/React Native JavaScript SDK is your entry-point to integrating passwordless authentication inside your application.
https://magic.link/docs/api-reference/client-side-sdks/web
Apache License 2.0
457 stars 85 forks source link

infinity warring logs in nextjs project <Third-party cookie will be blocked in future Chrome versions as part of Privacy Sandbox.> #779

Open FatmaMahmoud698 opened 1 month ago

FatmaMahmoud698 commented 1 month ago

βœ… Prerequisites

πŸ› Description

I had nextjs project and I integrate XDC network with magic-sdk everything is working fine but I face infinity warring logs Third-party cookie will be blocked in future Chrome versions as part of Privacy Sandbox. nextjs version 13.4.19 magic-sdk: 28.3.0 when deploy project on ec2 aws it crashed because of infinity warring logs

πŸ’» Code Sample


const { Web3 } = require("web3")
import { Magic } from "magic-sdk"
my function is 
      try {
        const magic = new Magic(process.env.NEXT_PUBLIC_MAGIC_API_KEY || "", {
          network: {
            rpcUrl: process.env.NEXT_PUBLIC_RPCURL,
            chainId: process.env.NEXT_PUBLIC_CHAINID,
          }
        });
        const web3 = await new Web3(magic.rpcProvider)
        const accounts = await web3?.eth.getAccounts()
        const contract = new web3.eth.Contract(murabhaContractABI.abi, murabhaContractABI.address);
        const gasPrice = await web3.eth.getGasPrice();
        const tx = await contract.methods.createToken(data.name, data.symbol).send({ from: accounts[0], gasPrice: gasPrice, });;
      } catch (error) {
        console.error('Error creating tokens', error.message);
      }
    } catch (error: any) {
      /// update error message
    }
  };

🌎 Environment

| Software | Version(s) | | nextjs | 13.4.19 | | magic-sdk | 28.3.0 | | Browser | chrome and firefox | | yarn | 1.22.17 | | Operating System | windows |

CryptoGraffe commented 3 weeks ago

We are hitting this as well and it is pretty crazy! Struggling to get magic working with rainbowkit.

Adebesin-Cell commented 2 weeks ago

@CryptoGraffe Can you state your issue? I'm having pretty same issues, can't seem to get it working, my wagmi.store states keep getting refreshed on page load, using dedicatedWalletConnector approach tho :))