wallet-adapter: WalletSignTransactionError: Something went wrong.
Describe the bug
When I’m testing in local development (w/ mainnet-beta and custom RPC), our airdrop code works perfectly. but when moving it into prod, it complains WalletSignTransactionError: Something went wrong.
. I checked all the ENV variables and made sure it was the same.
To Reproduce
const transaction = new Transaction();
// create token account
if (receiverAccount == null) {
transaction.add(
createAssociatedTokenAccountInstruction(
sender,
receiverATA,
receiver,
mint
)
);
}
// add transfer instruction
transaction.add(
createTransferCheckedInstruction(
senderATA,
mint,
receiverATA,
sender,
1,
0
)
);
const recentBlockhash = await connection.getLatestBlockhash();
transaction.recentBlockhash = recentBlockhash?.blockhash;
transaction.feePayer = sender;
await signTransaction(transaction);
Expected behavior I expected to work in both production and development
Screenshots
Desktop (please complete the following information):
- OS: MacOS monterey
- Browser chrome
- Version latest
Additional context NA
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 21 (1 by maintainers)
This is fixed in vercel/next.js v12.3.2-canary.32. Update and you’re on your way!
@steveluscher You’re right. swcMinify is the problem. Setting it to false in next.config.js makes the site works: https://nextsol.ibcoder.com
@YoungMahesh great! I might go ahead and do some testing with a vanilla Next app just to understand what the issue is and why the starter works if that doesn’t.
@jordansexton , I had exactly same problem mentioned by @stanleycyang on the top and using Next.js starter resolved my issue. (I also tried
Downgrading to Next.js ^11.1.4
as mentioned by @kimpers but it didn’t worked for me)This fails in local after build as well. Have similar issue but not entirely same, here in my devnet (so it doesn’t have any relation with devnet, testnet, mainnet) -> https://nextsol.ibcoder.com. GitHub code: https://github.com/vasudeveloper001/solana-next-app
It definitely fails during build in nextjs.
Using source-map debugging, it is pointing to wallet-adapter’s code around here:
adapter.js code piece pointed by source-maps.
Wallet-Provider calls adapter.js above
Weird thing, this used to work like few months back!
EDIT: Also tried changing the checkout page to getServerSideProps type. Doesn’t work. Removing authentication check on the page, doesn’t work either. And it fails with SolFare as well, so have nothing to do with Wallets either.
Thanks! I’ll test that.
Thanks, looking into this!