Hello! I'm trying out analytics engine

Hello! I'm trying out analytics engine in my worker. But whatever I do, I always run into the Cannot read properties of undefined (reading 'writeDataPoint') error.
It's a Typescript worker, and I'm simply calling env.VIEW_COUNTER.writeDataPoint() with
[[analytics_engine_datasets]]
binding = "VIEW_COUNTER"
dataset = "viewCounter"

in my
wrangler.toml


Wrangler correctly identifies env.VIEW_COUNTER as a analytics engine dataset when generating the types;

interface Env {
    VIEW_COUNTER: AnalyticsEngineDataset;
}


Analytics Engine is enabled in CloudFlare. What am I missing?
Was this page helpful?