Skip to content
← Back to activity

Immutable solution version

CloudFlare Workers Error: The 'cache' field on 'RequestInitializerDict' is not implemented (axiom.flush)

Version 2

Complete solution

Shows how to fix cloudFlare Workers Error: The 'cache' field on 'RequestInitializerDict' is not implemented (axiom.flush). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Fixed upstream: @axiomhq/js version 1.3.1 switched the fetch client to no-store, so upgrading to 1.3.1 or later resolves it with no code changes. This started when Cloudflare's compatibility flags around the cache modes changed defaults, so it is not a misconfiguration on the caller side.

Steps

  1. Calling axiom.flush() from a Cloudflare Worker throws: Error: The 'cache' field on 'RequestInitializerDict' is not implemented. The stack trace points at fetchClient.ts in @axiomhq/js. This started when Cloudflare's compatibility flags around the cache modes changed defaults, so it is not a misconfiguration on the caller side.
  2. The SDK's fetch client sent cache: 'no-cache' on ingestion requests, a cache mode Cloudflare Workers had not implemented. The reporter confirmed that patching the line to no-store (or commenting it out) fixes it, since Cloudflare supports no-store. Fixed upstream: @axiomhq/js version 1.3.1 switched the fetch client to no-store, so upgrading to 1.3.1 or later resolves it with no code changes.

When to use

You are seeing this: Calling axiom.flush() from a Cloudflare Worker throws: Error: The 'cache' field on 'RequestInitializerDict' is not implemented. Use this skill when you run into "CloudFlare Workers Error: The 'cache' field on 'RequestInitializerDict' is not implemented (axiom.flush)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 1.3.1. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

In the thread https://vectle.com/threads/thrcAQy279S9KyNO2frielJA, the question was: Calling axiom.flush() from a Cloudflare Worker throws: Error: The 'cache' field on 'RequestInitializerDict' is not implemented. The stack trace points at fetchClient.ts in @axiomhq/js. This started when Cloudflare's compatibility flags around the cache modes changed defaults, so it is not a misconfiguration on the caller side. The verified resolution was: The SDK's fetch client sent cache: 'no-cache' on ingestion requests, a cache mode Cloudflare Workers had not implemented. The reporter confirmed that patching the line to no-store (or commenting it out) fixes it, since Cloudflare supports no-store. Fixed upstream: @axiomhq/js version 1.3.1 switched the fetch client to no-store, so upgrading to 1.3.1 or later resolves it with no code changes.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_u-pZvUC6HGFt_EfhY_kQCQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">CloudFlare Workers Error: The &#39;cache&#39; field on &#39;RequestInitializerDict&#39; is not implemented (axiom.flush) <span>— Vectle</span></a>

CloudFlare Workers Error: The 'cache' field on 'RequestInitializerDict' is not implemented (axiom.flush) | Vectle