Getting ParsedProgramError when creating programmable NFTs on Solana

I’m trying to create a programmable NFT using the Metaplex SDK on Solana blockchain. My code builds the transaction correctly but fails when I try to send it to the network.

const nftBuilder = await metaplexInstance
  .nfts()
  .builders()
  .create({
    uri: tokenMetadataUri,
    name: tokenName,
    sellerFeeBasisPoints: royaltyFee,
    symbol: tokenSymbol,
    creators: creatorsList,
    isMutable: true,
    isCollection: false,
    tokenStandard: TokenStandard.ProgrammableNonFungible,
    ruleSet: null
  });

const result = await metaplexInstance.rpc().sendAndConfirmTransaction(nftBuilder, { commitment: 'finalized' });

The transaction building works fine but when I execute the sendAndConfirmTransaction method, I get this error:

ParsedProgramError: The program [TokenMetadataProgram] at address [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s] raised an error of code [1] that translates to “”.

What could be causing this issue and how can I resolve it?

Error code 1 is annoying because it’s so vague. Wrap your sendAndConfirmTransaction in a try-catch block and log the entire error object - you’ll often find more details hiding in there. Also check your sellerFeeBasisPoints value. I’ve seen this break when the royalty percentage is formatted incorrectly or goes over 10000 basis points.

Interesting error! I’ve hit similar issues with pNFTs before, though usually different error codes. Are you using the latest Metaplex SDK? I’ve seen weird behavior with older versions on programmable NFTs.

What does your creatorsList structure look like? Sometimes the issue isn’t in the main params but how the creators array is formatted. Make sure each creator has proper address, share, and verified fields.

One thing caught my eye - you’re setting ruleSet: null which should work for basic pNFTs, but try explicitly setting it to PublicKey.default() instead. Some program versions are picky about null vs default pubkey.

Quick question - devnet or mainnet? If mainnet, double-check all your dependencies point to the right program addresses. The metadata program address sometimes gets mixed up between networks.

Also curious what your tokenMetadataUri returns - does it have all required fields for programmable NFTs? The standard’s pretty strict about certain metadata requirements for pNFTs vs regular NFTs.

Had the same issue last month - it’s usually the token standard config. Error code 1 from Token Metadata Program means you’ve got a constraint violation. When I used TokenStandard.ProgrammableNonFungible, I had to set up the authority config properly. Add the updateAuthority parameter directly in your builder and check that your wallet has enough SOL for fees. Make sure your metadata URI works and follows Metaplex standards. One trick that worked for me: add a short delay between building and sending the transaction. The metadata program sometimes needs a sec to process the initial setup.