-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WalletSignTransactionError: Something went wrong. #581
Comments
Hi @stanleycyang, Thanks for your question! We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of Solana itself. Questions like yours deserve a purpose-built Q&A forum. Unless there exists evidence that this is a bug with Solana itself, please post your question to the Solana Stack Exchange using this link: https://solana.stackexchange.com/questions/ask This automated message is a result of having added the ‘question’ tag. |
If the signing request is reaching the wallet, this doesn't seem related to Wallet Adapter. Unfortunately we can't help troubleshoot issues with wallets or deployment environments. |
Also just noting, your reproduction code isn't something I can run. Lots of variables not defined, and you said it works in development against mainnet anyway. This points to an issue with your production build or environment. |
Fair enough. I am seeing the try catch fail specifically around the |
That's not a recurring issue. That's two different issues with different JS libraries under different circumstances. Their commonality is most likely user error. Please follow up if you find a bug that can be reproduced with a complete repo. For example, if you provide a repo with a Next.js that works locally on mainnet but fails when deployed, I can take a look. |
Hey @jordansexton, here is a test repo: https://conversion-test.vercel.app/ Here is the code: https://github.com/fellowshipdao/conversion-test. I just ramped it up locally with some of the example repo code and it seems like it works locally but not in prod. any idea? |
Thanks, looking into this! |
Hearing some talk about other people having issues on deployment to Vercel now as well with the core solana labs libs. I'm having trouble debugging since the error code is fairly generic. any ideas on what I did wrong here? |
Can you try to deploy the Next.js starter project and tell me if there are issues there? I've run this locally without a problem, but haven't deployed it recently. You may have to update the config to include the wallets you're testing. |
I believe I deployed almost that code in the other instance. I can try and clone and deploy this one |
For what it's worth this does not seem to have anything to do with Vercel but rather the Next.js build process. Running |
Thanks! I'll test that. |
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. async sendTransaction(transaction, connection, options = {}) {
try {
const wallet = this._wallet;
if (!wallet)
throw new WalletNotConnectedError();
try {
const { signers, ...sendOptions } = options;
transaction = await this.prepareTransaction(transaction, connection, sendOptions);
signers?.length && transaction.partialSign(...signers);
sendOptions.preflightCommitment = sendOptions.preflightCommitment || connection.commitment;
const { signature } = await wallet.signAndSendTransaction(transaction, sendOptions);
return signature;
}
catch (error) {
if (error instanceof WalletError)
throw error;
throw new WalletSendTransactionError(error?.message, error);
}
}
catch (error) {
this.emit('error', error);
throw error;
}
} Wallet-Provider calls adapter.js above const sendTransaction = useCallback(
async (transaction, connection, options) => {
if (!adapter) throw handleError(new WalletNotSelectedError());
if (!connected) throw handleError(new WalletNotConnectedError());
return await adapter.sendTransaction(transaction, connection, options);
},
[adapter, handleError, connected]
); 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. |
It seems like this issue is related to some change with the build/tree shaking process for Next.js 12. Downgrading to Next.js |
Hmm, the example and nextjs-starter projects both use Next 12 and build and run locally for me. I'll try with them moved out of the workspace in case it's a dependency resolution issue. |
@jordansexton , I had exactly same problem mentioned by @stanleycyang on the top and using Next.js starter resolved my issue. (I also tried |
@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. |
I'm going to guess this is related to vercel/next.js#41527 and fixed by swc-project/swc#6201. Were you folks using the |
@steveluscher You're right. swcMinify is the problem. Setting it to false in next.config.js makes the site works: https://nextsol.ibcoder.com |
This is fixed in vercel/next.js v12.3.2-canary.32. Update and you're on your way! |
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
Expected behavior
I expected to work in both production and development
Screenshots
Desktop (please complete the following information):
Additional context
NA
The text was updated successfully, but these errors were encountered: