Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable cache: "no-store" after 9.0.5 update #273

Open
tdwells90 opened this issue Oct 18, 2023 · 4 comments
Open

How to disable cache: "no-store" after 9.0.5 update #273

tdwells90 opened this issue Oct 18, 2023 · 4 comments

Comments

@tdwells90
Copy link

Hi,

In Cloudflare Workers I'm receiving the error: The 'cache' field on 'RequestInitializerDict' is not implemented. This is due to the latest 9.0.5 update. 9.0.4 works fine.

Is there a way to remove this for 9.0.5 and any future updates?

Thanks,
Tom.

@max-stytch
Copy link
Contributor

Hey @tdwells90 for immediate resolution can you try using the workaround described in #262 (comment) to manually edit the fetchConfig?

something like

function monkeyPatchStytchClientSettings(client: ...) {
  /* eslint-disable */
  const cl = <any>client;
  /* eslint-enable */
  cl.fetchConfig.cache = undefined;
}

should hopefully do the trick since the explicit undefined should override the key.

> { foo: 1, ...{foo: undefined}}
{ foo: undefined }

We'll see if we can detect the CF worker runtime and avoid setting that key as an immediate fix.

Would also be great for us to add automated tests that deploy to Cloudflare and verify that we don't break things. Right now that process is manual and we're not running it on every commit.

@max-stytch
Copy link
Contributor

@tdwells90 is this solution- cloudflare/workerd#698 (comment) - a viable workaround? It looks like cloudflare themselves plan on fixing this issue in some near future 🤞

@kyleplo
Copy link

kyleplo commented Nov 15, 2023

Going into /node_modules/stytch/dist/shared/index.js and commenting out the line that says cache: "no-store" (currently line 19) worked for me

@cmnstmntmn
Copy link

any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants