ERROR Failed to read data from robots.txt/robots.txt: Data not supported for extension 'txt'

can’t build site after upgrading Hugo v0.40.2 and gives this error. Before I had v0.32.4 and didn’t show any error while building. The file currently in static folder.

ERROR 2018/05/07 15:21:13 Failed to read data from robots.txt/robots.txt: Data not supported for extension ‘txt’

any idea how to fix?

I tried
disableRobotsTXT = true
disableKinds = [“robotsTxt”]

or moving my robots.txt file to layouts/_default.

The error says that you have a txt file inside /data. Remove/move that.

Thanks bep.
I had the file in static and data folders. I didn’t notice that’s it’s in Data. I removed it and that fixed the problem.