Iframe is malformed! MALFORMED_RESPONSE
✅ 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 -
- Use
loginWithMagicLink()to connect to the wallet - 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 |
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.
Closing because the steps to reproduce have not been provided.