Title: Error: Missing required argument count for minting. Please provide the argument in the mintParams
Tags: nft;crossmint
Question: I am trying to implement crossmint-pay-button using javascript.
I am using cdn link: https://unpkg.com/@frankward@example.net/lib/index.global.js
<crossmint-pay-button
collectionTitle=&quot;Gaia comic&quot;
collectionDescription=&quot;Gaia comic collection &quot;
collectionPhoto=&quot;&quot;
clientId=&quot;8d77450f.....ad497f612&quot;
mintConfig='{&quot;type&quot;:&quot;erc-721&quot;,&quot;price&quot;:&quot;0.1&quot;,&quot;_count&quot;:&quot;1&quot;}'
environment=&quot;staging&quot;
When I click Pay button below error gets.
&quot;Missing required argument count for minting. Please provide the argument in the mintParams&quot;

Here is the accepted answer: Thanks guys its working now.
I changed mintConfig parameters &quot;_count&quot; to &quot;count&quot; and added one more additional parameter &quot;to&quot; and also updated &quot;price&quot; to higher level.
<crossmint-pay-button
collectionTitle=&quot;Gaia comic&quot;
collectionDescription=&quot;Gaia comic collection &quot;
collectionPhoto=&quot;&quot;
clientId=&quot;8d77450f.....ad497f612&quot;
mintConfig='{&quot;type&quot;:&quot;erc-721&quot;,&quot;price&quot;:&quot;1&quot;,&quot;count&quot;:&quot;1&quot;,&quot;to&quot;:&quot;$CrossmintUserAddress&quot;}'
environment=&quot;staging&quot;
Comment for this answer: Just noticed that you included the to parameter in the mintConfig. You can skip that. Crossmint will take care of this argument.

Here is another answer: The error message is misleading. Where it says mintParams, it should say mintConfig.
With that in mind: what error is saying is that your contract abi is expecting a count argument to mint, and this argument should be passed in the mintConfig object.
In your case, you are passing the argument _count. If you rename it to count, that should work.
See below:
<crossmint-pay-button
collectionTitle=&quot;Gaia comic&quot;
collectionDescription=&quot;Gaia comic collection &quot;
collectionPhoto=&quot;&quot;
clientId=&quot;8d77450f.....ad497f612&quot;
mintConfig='{&quot;type&quot;:&quot;erc-721&quot;,&quot;price&quot;:&quot;0.1&quot;,&quot;count&quot;:&quot;1&quot;}'
environment=&quot;staging&quot;
/&gt;
Reach out to the crossmint team on discord if this doesn't work for you!
Comment for this answer: Hey thanks for the answer. I renamed it to "count" but still not working. Giving same error. I raised this issue on discord with the team but they asked me to post in stackoverflow.
Comment for this answer: @alfongj  yes your are right, now the error is different. It says "Missing required argument to for minting. Please provide the argument in the mintParams"
Comment for this answer: Mind adding a screenshot of the error you see if you use this code snippet? I believe it may be a different error

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:05/18/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<nft><crossmint>', 'Title': 'Error: Missing required argument count for minting. Please provide the argument in the mintParams', 'ViewCount': 100, 'id': 72294510, 'user_AboutMe': '<p>Passionate Frontend Developer with 7+ years of strong experience providing high-impact web solutions for diverse domains. Skilled in designing and developing multiple web-based applications. Well-versed with React, JavaScript, Typescript and HTML/CSS.</p>\n', 'user_AccountId': 10764035.0, 'user_DisplayName': 'Tushar kharat', 'user_Reputation': 51.0, 'user_Views': 5.0, 'user_id': 7919629.0}}