Skip to content
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

TypeError: Cannot read properties of undefined (reading 'array') #3156

Open
raiusamakhalid2 opened this issue Aug 7, 2024 · 5 comments
Open
Labels

Comments

@raiusamakhalid2
Copy link

Screenshot from 2024-08-07 17-16-58

const account = {
authority: anchorWalletObj.publicKey,
collectionMint: collectionPDA,
metadataAccount: metadataAccount,
masterEdition: masterEditionAccount,
tokenAccount: associatedTokenAccount,
tokenMetadataProgram: MPL_TOKEN_METADATA_PROGRAM_ID,
systemProgram: anchor.web3.SystemProgram.programId,
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
};

const tx = await program.methods
  .createCollectionNft(name, symbol, jsonUri)
  .accounts(account)
  .signers([])
  .rpc();
@acheroncrypto
Copy link
Collaborator

You seem to be using v0.29 which has the following code:

This has already been fixed in v0.30 (#2824):

@raiusamakhalid2
Copy link
Author

i,m using v0.30.1

@acheroncrypto
Copy link
Collaborator

That's weird because there is no unchecked .array access in v0.30 as mentioned above. Let's reopen it then, but note that there isn't enough information to reproduce this problem.

Also FYI: you should be able to remove at least half of those accounts (from client), see account-resolution.

@acheroncrypto acheroncrypto reopened this Aug 8, 2024
@raiusamakhalid2
Copy link
Author

[package]
name = "nft_collection"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "nft_collection"

[features]
default = []
cpi = ["no-entrypoint"]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
idl-build = [
"anchor-lang/idl-build",
"anchor-spl/idl-build",
]

[dependencies]
anchor-lang = { version = "0.30.1", features = ["init-if-needed"] }
anchor-spl = { version = "0.30.1", features = ["metadata"] }
mpl-token-metadata = "4.1.2"

@raiusamakhalid2
Copy link
Author

That's weird because there is no unchecked .array access in v0.30 as mentioned above. Let's reopen it then, but note that there isn't enough information to reproduce this problem.

Also FYI: you should be able to remove at least half of those accounts (from client), see account-resolution.

still can,t resolve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants