Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'toBase58') #2360

Closed
cangcang opened this issue Mar 22, 2024 · 3 comments
Labels
question Add this to close an issue with instructions on how to repost as a question on Stack Exchange

Comments

@cangcang
Copy link

Overview

Steps to reproduce

const publicKey = traderKeypair.publicKey;
const address = publicKey.toBase58();
console.log('Solana Address:', address);

const message = new web3.TransactionMessage({
payerKey: traderKeypair.publicKey,
instructions: [setupNewMakerIxs],
recentBlockhash,
}).compileToV0Message();

Description of bug

publicKey.toBase58() can get value ,but TransactionMessage first parameter payerKey:Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'toBase58') ,Findings bug is "@solana/web3.js/lib/index.cjs.js:626:30) " ,When calling compileToV0Message
image
pubkey firtst can get value ,second pubkey is null

@cangcang cangcang added the bug Something isn't working label Mar 22, 2024
@buffalojoec
Copy link
Contributor

I think this is likely an issue with your instruction, because reproducing your issue without your setupNewMakerIxs works fine!

Try digging around your instruction and make sure you're providing valid keys.

@buffalojoec buffalojoec added question Add this to close an issue with instructions on how to repost as a question on Stack Exchange and removed bug Something isn't working labels Mar 22, 2024
Copy link
Contributor

Hi @cangcang,

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 the Solana JavaScript SDK itself.

Questions like yours deserve a purpose-built Q&A forum. Unless there exists evidence that this is a bug with the Solana JavaScript SDK 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.

Copy link
Contributor

github-actions bot commented Apr 1, 2024

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Add this to close an issue with instructions on how to repost as a question on Stack Exchange
Projects
None yet
Development

No branches or pull requests

2 participants