What is wrong with my statistics sensor?

I have the same problem. Getting an error if I use platform: statistics, avarage or history. If i read it correctly, could it be that some of my !include lines are interfering with it? I have these includes:
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml