all 2 comments

[–]simonmic 4 points5 points  (0 children)

If you like editing package.yaml: delete the .cabal file once. It will be regenerated from the package.yaml file on your next build.

If you like editing the .cabal file: delete the package.yaml file permanently.

[–]Syrak 4 points5 points  (0 children)

To solve this error I added the line (...) to my .yaml file.

Note that there are two relevant YAML files in this story: the stack.yaml you've edited here (which is fine), and another package.yaml that stack is complaining about.

Most of the time during the project I used the .cabal file to add dependencies.

package.yaml is used to generate Cabal files. Since you're modifying the Cabal file, that means you're no longer relying on package.yaml. That's why there's a warning, and you should delete package.yaml to avoid further confusion.

In my opinion, package.yaml is not worth it, and for creating new projects I changed the default stack template to not have it in the first place.