Add Annotation Query Throws $watch is not a function TypeError

I am using Grafana 11.0.0 running in docker desktop in WSL.

In a dashboard I go to settings->Annotations-> Add Annotation Query and I get this error:

TypeError: this.angularComponent.getScope(…).$watch is not a function
An unexpected error happened
Details
TypeError: this.angularComponent.getScope(…).$watch is not a function

I have Tried:

  • On an empty new dashboard
  • On a dashboard with populated visuals
  • On a different computer with a different install
  • I tried setting angular_support_enabled = true in the grafana.ini

I am able to successfully modify the first Query (grafan alerts), but I cannot add new queries:

Error From Browser

1 Like

I updated to the latest grafana 11.2.0. The error persists.

1 Like

I had the same issue, I found a workaround. By default when you add a new annotation query, it will take your default datasource annotation support. On my side I had a custom datasource I made as default datasource, so I just added annotation support on it by adding to my datasource class the following property:
annotations: AnnotationSupport<QueryType> = {};