Getting ParsedProgramError when creating programmable NFT on Solana

I’m trying to create a programmable NFT using the Metaplex SDK but running into issues. Here’s my code:

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

let { signature, confirmResponse } = await metaplexInstance.rpc().sendAndConfirmTransaction(builder, { commitment: 'finalized' });

The error happens when I try to send the transaction. I get this error message:

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?

check ur wallet’s SOL balance - you might not have enough for transaction fees. programmable NFTs need more accounts than regular ones, so they’re pricier to mint. try adding collection: null even tho you’ve set isCollection to false. the Metaplex builder gets confused without it. I had same issue last month and that fixed it.

Had this same error a few weeks back with programmable NFTs. You’re probably missing required accounts in the transaction. Even if you’re setting ruleSet to null, add the authorizationRulesProgram parameter to your builder config. Also update your Metaplex SDK - I was running an old version that didn’t play nice with the current Token Metadata program. Error code 1 is annoyingly vague but usually means missing account or bad instruction data. Don’t forget to include all required creator signatures if any creators need to sign.

hmm, this is interesting - i’ve been experimenting with programmable nfts lately too and that error code is really frustrating when it doesn’t give you much to work with!

are you using the latest version of the token metadata program? i’m curious what version of the metaplex sdk you’re running because i noticed some compatibility issues between different versions. also, when you say the error happens “when you try to send the transaction” - is it failing during the build phase or actually during the rpc call?

one thing that caught my eye - you mentioned setting ruleSet: null but have you tried explicitly passing the authorization rules program id even when not using a custom ruleset? sometimes the program expects certain accounts to be present even if they’re not being used.

also just wondering - are you testing this on devnet or mainnet? and what’s your RPC endpoint situation like? sometimes these parsed program errors can actually be network related rather than code issues.

would be curious to see if you get any more detailed logs if you add some debug output before the transaction gets sent. the metaplex builder sometimes has internal validation that might give us better clues about what’s missing :thinking: