cloudflare / cloudflare/workerd

RestError: Error sending request: Unsupported cache mode: no-store

Open
#2,426 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

Hi, I'm using Azure Communication Services to send emails. Unfortunately, their library hard codes cache no-store which I have no way to remove:
https://github.com/Azure/azure-sdk-for-js/blob/424bfd1b507ba02e1895269a91f224fd55cfddb5/sdk/core/core-rest-pipeline/src/fetchHttpClient.ts#L72

And Cloudflare Pages Function throws an error when that's set preventing the request from working:
> [ERROR] RestError: Error sending request: Unsupported cache mode: no-store You may need to enable the cache_option_enabled compatability flag.

I tried setting `compatibility_flags=["cache_option_enabled"]` in wrangler.toml without success, it just removed the suggestion from error message.

I'm just wondering is there a reason this is an error instead of a warning and just proceed with sending request?

Edit:
Found workaround, use [patch-package](https://www.npmjs.com/package/patch-package) to modify [@azure/core-rest-pipeline](https://www.npmjs.com/package/@azure/core-rest-pipeline) to remove all instances of `cache: "no-store"`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.