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

"The 'cache' field on 'RequestInitializerDict' is not implemented" in live cloudflare worker #338

Closed
tobbbe opened this issue Apr 4, 2023 · 6 comments

Comments

@tobbbe
Copy link

tobbbe commented Apr 4, 2023

Getting The 'cache' field on 'RequestInitializerDict' is not implemented. when trying to run this code in a worker (live). It does work fine in locally though. Whats wrong? 🤔

import { Redis } from '@upstash/redis/cloudflare'

const cfModule = {
  async fetch(request: Request, env: Env) {
    const asd = await Redis.fromEnv(env).lrange('asd', 0, 100)
    return new Response(JSON.stringify(asd), {
      headers: { 'Content-Type': 'application/json' },
    })
  },
}
@tobbbe tobbbe changed the title The 'cache' field on 'RequestInitializerDict' is not implemented. "The 'cache' field on 'RequestInitializerDict' is not implemented" in live cloudflare worker Apr 4, 2023
@chronark
Copy link
Contributor

chronark commented Apr 4, 2023

Thanks, I'll fix it. In the meantime, can you try an older version, 1.19.1 should work

@tobbbe
Copy link
Author

tobbbe commented Apr 4, 2023

1.19.1 works! Thanks! 🙌

@tobbbe tobbbe closed this as completed Apr 4, 2023
@chronark chronark reopened this Apr 4, 2023
@chronark
Copy link
Contributor

chronark commented Apr 4, 2023

Let's keep it open until I can fix it

@donchev7
Copy link

donchev7 commented Apr 9, 2023

I can confirm that this bug exists only on 1.20.2 . After reverting dependabot PR to 1.20.1 it works as expected.

@donchev7
Copy link

I believe this commit introduced the "bug".

However, I believe its only relevant on cloudflare since they do not support the cache field in fetch but other platforms do.
We might track this issue and see if they add support for the cache field....

@chronark
Copy link
Contributor

Sorry about that, our ci broke and didn't catch this before releasing
Fixed it in v1.20.3

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

3 participants