magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

Iframe is malformed! MALFORMED_RESPONSE

Open pchy10 opened this issue 3 years ago • 1 comments

✅ Prerequisites

  • [x] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • [x] Are you running the latest SDK version?
  • [x] Are you reporting to the correct repository (magic-sdk)?

🐛 Description

A connected (to the Magic wallet) user received the following error message while performing a transaction using magic-sdk.

Magic SDK Error: [MALFORMED_RESPONSE] Response from the Magic iframe is malformed

🧩 Steps to Reproduce

This error doesn't show always. So this is the error I received while performing a deposit into my web3 app for testnet. Here are some steps I followed -

  1. Use loginWithMagicLink() to connect to the wallet
  2. Perform any deposit/ withdraw

🤔 Expected behavior

The magic wallet should allow performing this transaction without any error.

😮 Actual behavior

Received the error in a try-catch block.

💻 Code Sample

I have used magic-sdk to connect a user in my app. So to connect to the wallet I've followed the doc -

async function connect(){
    try {
        const m = new Magic('API_KEY');
        await m.auth.loginWithMagicLink({ email: '[email protected]' });
    } catch (error) {
        console.error(error);
    }
}

🌎 Environment

Software Version(s)
magic-sdk ^8.1.1
Browser Chrome Mobile
yarn 1.0.2
Operating System Android 12

pchy10 avatar Aug 25 '22 14:08 pchy10

Hello @prosenjitalpine and thank your for opening this issue. I am unable to reproduce this error. You stated above that the error is a result of performing a deposit/withdrawal but you have not provided the corresponding code snippet.

Please share a sandbox or code snippet of how you are making these contract calls. This will help us better understand your issue.

Our docs How to Integrate with the Ethereum Blockchain with Magic in Javascript will guide you in setting up your project using Ethers.js or Web3.js.

am-hernandez avatar Aug 26 '22 14:08 am-hernandez

Closing because the steps to reproduce have not been provided.

am-hernandez avatar Nov 03 '22 19:11 am-hernandez