-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Copy link
Labels
bugSomething that isn't workingSomething that isn't working
Description
Which Cloudflare product(s) does this pertain to?
Wrangler
What versions & operating system are you using?
wrangler 4.13.0
Please provide a link to a minimal reproduction
No response
Describe the Bug
With wrangler versions >= 4.13.0, if you have an older compatibility_date and are using Analytics Engine, writeDataPoint calls now throw errors locally.
In your wrangler config:
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "ae-repro",
"main": "src/index.ts",
"compatibility_date": "2023-10-31",
"observability": {
"enabled": true
},
"analytics_engine_datasets": [{
"binding": "ANALYTICS",
"dataset": "test"
}]
}src/index.ts:
export default {
async fetch(request, env, ctx): Promise<Response> {
env.ANALYTICS.writeDataPoint({
blobs: [
"foo"
]
})
return new Response('Hello World!');
},
} satisfies ExportedHandler<Env>;npx wrangler@4.12.0 dev, hit worker, no errorsnpx wrangler@4.13.0 devhit worker, observeTypeError: env.ANALYTICS.writeDataPoint is not a functionerrors
Please provide any relevant error logs
✘ [ERROR] WARNING: Tried to access method or property 'writeDataPoint' on a Service Binding or Durable Object stub. Are you trying to use RPC? If so, please enable the 'rpc' compat flag or update your compat date to 2024-04-03 or later (see https://developers.cloudflare.com/workers/configuration/compatibility-dates/ ). If you are not trying to use RPC, please note that in the future, this property (and all other property names) will appear to be present as an RPC method.
[wrangler:err] TypeError: env.ANALYTICS.writeDataPoint is not a function
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that isn't workingSomething that isn't working
Type
Projects
Status
Done