I have troubles configuring Grafana alerts with Loki. When I switch to the alerts page I always get the following:

In the browser devtools I see:

Here is the ruler part of my loki.yaml:
ruler:
storage:
type: local
local:
directory: /data/loki/rules
rule_path: /data/loki/scratch
alertmanager_url: http://alertmanager-operated.svc.cluster.local:9093
ring:
kvstore:
store: inmemory
enable_api: true
enable_alertmanager_v2: true
What am I doing wrong?
You should first check loki api
GET ~/loki/api/v1/rulesgive the correct response.