'Solana Anchor deploy error. bump targets should not be provided with init. please use bump without a target

When I run anchor deploy, I am getting this error. bump targets should not be provided with init. please use bump without a target How can I fix it?



Solution 1:[1]

What version of anchor you running ?

0.21.0 added breaking change with bumps

https://github.com/project-serum/anchor/blob/master/CHANGELOG.md

lang: Providing bump = targets with init will now error. On init only, it is required to use bump without a target and access the seed inside function handlers via ctx.bumps.get("<pda-account-name"). For subsequent seeds constraints (without init), it is recommended to store the bump on your account and use it as a bump = target to minimize compute units used

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DupeTroop