When trying to delete a feature flag that exist in multiple Environments, The error below show up:
However, after deleting all the custom targeting rules, the error persist.
The error is referring to all the feature flag definitions within the environment, meaning, Treatments, Individual targets, Dynamic Configs and Default Rules in addition to the Custom Targeting Rules.
To delete all the definitions, click on the second (...) icon from the top right and click on Delete targeting rules option
Repeat the same action for all other Environments that the feature flag is added to. Then the delete feature flag option will work successfully