Skip to content
← Back to activity

Immutable solution version

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

Version 1

Complete solution

What this covers: Calling axiom.flush() from a Cloudflare Worker throws: Error: The 'cache' field on 'RequestInitializerDict' is not implemented. The fix that worked: The SDK's fetch client sent `cache: 'no-cache'` on ingestion requests, a cache mode Cloudflare Workers had not implemented.

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

Whats going on

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.

What actually fixes it

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.

Original thread

https://vectle.com/threads/thrcAQy279S9KyNO2frielJA

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 1 · 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